Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
494941b3
Commit
494941b3
authored
Jul 29, 2019
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QT: Fix rendering of dashed lines.
parent
712f4c9a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
14 deletions
+11
-14
xtt/lib/ge/qt/ge_qt.cqt
xtt/lib/ge/qt/ge_qt.cqt
+3
-3
xtt/lib/glow/qt/glow_draw_qt.cqt
xtt/lib/glow/qt/glow_draw_qt.cqt
+8
-11
No files found.
xtt/lib/ge/qt/ge_qt.cqt
View file @
494941b3
...
...
@@ -1699,11 +1699,11 @@ GeQt::GeQt(void* x_parent_ctx, ldh_tSesContext x_ldhses, int x_exit_when_close,
// Line type option menu
QComboBox* tools_linetype
= addToolMenu(toplevel, tools3, SLOT(activate_linetype(int)));
for (int i =
1; i <=
7; i++) {
for (int i =
0; i <
7; i++) {
std::ostringstream txt;
txt << "Linetype " <<
i
;
txt << "Linetype " <<
(i + 1)
;
std::ostringstream fname;
fname << "$pwr_exe/ge_linetype_" <<
i
<< ".png";
fname << "$pwr_exe/ge_linetype_" <<
(i + 1)
<< ".png";
tools_linetype->addItem(
get_icon(fname.str().c_str()), txt.str().c_str(), i);
}
...
...
xtt/lib/glow/qt/glow_draw_qt.cqt
View file @
494941b3
...
...
@@ -926,7 +926,8 @@ void GlowDrawQt::line(int x1, int y1, int x2, int y2,
if (line_type != glow_eLineType_Solid) {
QPen pen = painter.pen();
pen.setWidth(idx + 1);
pen.setStyle(Qt::DashLine);
pen.setStyle(Qt::CustomDashLine);
pen.setCapStyle(Qt::FlatCap);
pen.setJoinStyle(Qt::MiterJoin);
QVector<double> dashes;
switch (line_type) {
...
...
@@ -943,26 +944,22 @@ void GlowDrawQt::line(int x1, int y1, int x2, int y2,
break;
}
case glow_eLineType_Dotted: {
dashes << 1 + idx << 1 + idx;
dashes << 1 + 4 * idx << 1 + 4 * idx;
dashes << 1 + idx << 1 + 4 * idx;
break;
}
case glow_eLineType_DotDashed1: {
dashes << 1 + 3 * idx << 1 + 3 * idx;
dashes << 1 + 2 * idx << 1 + 2 * idx;
dashes << 1 + idx << 1 + idx;
dashes << 1 + 2 * idx << 1 + 2 * idx;
dashes << 1 + 3 * idx << 1 + 2 * idx << 1 + idx << 1 + 2 * idx;
break;
}
case glow_eLineType_DotDashed2: {
dashes << 1 + 6 * idx << 1 + 6 * idx;
dashes << 1 + 3 * idx << 1 + 3 * idx;
dashes << 1 + idx << 1 + idx;
dashes << 1 + 3 * idx << 1 + 3 * idx;
dashes << 1 + 6 * idx << 1 + 3 * idx << 1 + idx << 1 + 3 * idx;
break;
}
default:;
}
for (int i = 0; i < dashes.size(); i++) {
dashes[i] /= (1 + idx);
}
pen.setDashPattern(dashes);
painter.setPen(pen);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment