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
df1d89b8
Commit
df1d89b8
authored
Nov 30, 2020
by
Christoffer Ackelman
Committed by
Esteban Blanc
Dec 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QT: Made dashed lines shorter.
parent
beed7f1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
56 deletions
+18
-56
xtt/lib/flow/qt/flow_draw_qt.cqt
xtt/lib/flow/qt/flow_draw_qt.cqt
+9
-29
xtt/lib/glow/qt/glow_draw_qt.cqt
xtt/lib/glow/qt/glow_draw_qt.cqt
+9
-27
No files found.
xtt/lib/flow/qt/flow_draw_qt.cqt
View file @
df1d89b8
...
...
@@ -111,42 +111,22 @@ static unique_ptr<QPainter> get_painter(
QPaintDevice* window, FlowDrawQt* draw_ctx, int painter_type, int size)
{
unique_ptr<QPainter> painter(new QPainter(window));
switch (painter_type) {
case flow_eDrawType_LineDashed:
case flow_eDrawType_LineDashedRed: {
painter->setBrush(QBrush(draw_type_to_color(draw_ctx, painter_type)));
painter->setBackground(QBrush(draw_ctx->background));
QPen pen = QPen(painter->brush(), size + 1, Qt::DashLine);
painter->setBrush(QBrush(draw_type_to_color(draw_ctx, painter_type)));
painter->setBackground(QBrush(draw_ctx->background));
painter->setPen(QPen(painter->brush(), size + 1));
if (painter_type == flow_eDrawType_LineDashed || painter_type == flow_eDrawType_LineDashedRed) {
QPen pen = painter->pen();
QVector<double> dashes;
dashes <<
7 + size << 7 + size
;
dashes <<
(7 + size) / pen.widthF() << (7 + size) / pen.widthF()
;
pen.setDashPattern(dashes);
painter->setPen(pen);
return painter;
}
case flow_eDrawType_TextHelvetica:
case flow_eDrawType_TextHelveticaBold:
case flow_eDrawType_TextHelveticaErase:
case flow_eDrawType_TextHelveticaEraseBold: {
painter->setBrush(QBrush(draw_type_to_color(draw_ctx, painter_type)));
painter->setPen(QPen(painter->brush(), size + 1));
painter->setBackground(QBrush(draw_ctx->background));
if (painter_type >= flow_eDrawType_TextHelvetica &&
painter_type <= flow_eDrawType_TextHelveticaEraseBold) {
int sizes[9] = {8, 10, 12, 14, 14, 18, 18, 18, 24};
painter->setFont(get_font(painter_type, sizes[size], "Helvetica"));
return painter;
}
case flow_eDrawType_Green:
case flow_eDrawType_Yellow:
case flow_eDrawType_DarkGray:
case flow_eDrawType_Line:
case flow_eDrawType_LineErase:
case flow_eDrawType_LineRed:
case flow_eDrawType_LineGray:
default:
painter->setBrush(QBrush(draw_type_to_color(draw_ctx, painter_type)));
painter->setBackground(QBrush(draw_ctx->background));
painter->setPen(QPen(painter->brush(), size + 1));
return painter;
}
return painter;
}
static QColor flow_allocate_color(FlowDrawQt* draw_ctx, const char* named_color)
...
...
xtt/lib/glow/qt/glow_draw_qt.cqt
View file @
df1d89b8
...
...
@@ -159,41 +159,23 @@ static unique_ptr<QPainter> get_painter(
QPaintDevice* window, GlowDrawQt* draw_ctx, int painter_type, int size)
{
unique_ptr<QPainter> painter = new QPainter(window);
switch (painter_type) {
case glow_eDrawType_LineDashed:
case glow_eDrawType_LineDashedRed: {
painter->setBrush(QBrush(draw_type_to_color(draw_ctx, painter_type, size)));
painter->setBackground(QBrush(draw_ctx->background));
QPen pen = QPen(painter->brush(), size + 1, Qt::DashLine);
painter->setBrush(QBrush(draw_type_to_color(draw_ctx, painter_type, size)));
painter->setBackground(QBrush(draw_ctx->background));
painter->setPen(QPen(painter->brush(), size + 1));
if (painter_type == glow_eDrawType_LineDashed || painter_type == glow_eDrawType_LineDashedRed) {
QPen pen = painter->pen();
QVector<double> dashes;
dashes <<
7 + size << 7 + size
;
dashes <<
(7 + size) / pen.widthF() << (7 + size) / pen.widthF()
;
pen.setDashPattern(dashes);
painter->setPen(pen);
return painter;
}
case glow_eDrawType_TextHelvetica:
case glow_eDrawType_TextHelveticaBold:
case glow_eDrawType_TextHelveticaErase:
case glow_eDrawType_TextHelveticaEraseBold: {
painter->setBrush(QBrush(draw_type_to_color(draw_ctx, painter_type, size)));
painter->setPen(QPen(painter->brush(), size + 1));
painter->setBackground(QBrush(draw_ctx->background));
if (painter_type >= glow_eDrawType_TextHelvetica &&
painter_type <= glow_eDrawType_TextHelveticaEraseBold) {
if (size > 0) {
painter->setFont(get_font(glow_eFont_Helvetica, painter_type, size));
}
return painter;
}
case glow_eDrawType_Line:
case glow_eDrawType_LineErase:
case glow_eDrawType_LineRed:
case glow_eDrawType_LineGray:
default: {
painter->setBrush(QBrush(draw_type_to_color(draw_ctx, painter_type, size)));
painter->setBackground(QBrush(draw_ctx->background));
painter->setPen(QPen(painter->brush(), size + 1));
return painter;
}
}
return painter;
}
static QColor glow_allocate_named_color(
...
...
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