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
e3390825
Commit
e3390825
authored
Apr 01, 2019
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed flow pixmaps always being drawn in black.
parent
f32864a0
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
30 deletions
+22
-30
xtt/lib/flow/gtk/flow_draw_gtk.cpp
xtt/lib/flow/gtk/flow_draw_gtk.cpp
+7
-11
xtt/lib/flow/gtk/flow_draw_gtk.h
xtt/lib/flow/gtk/flow_draw_gtk.h
+1
-1
xtt/lib/flow/qt/flow_draw_qt.cqt
xtt/lib/flow/qt/flow_draw_qt.cqt
+4
-9
xtt/lib/flow/qt/flow_draw_qt.h
xtt/lib/flow/qt/flow_draw_qt.h
+1
-1
xtt/lib/flow/src/flow_annotpixmap.cpp
xtt/lib/flow/src/flow_annotpixmap.cpp
+5
-4
xtt/lib/flow/src/flow_draw.h
xtt/lib/flow/src/flow_draw.h
+1
-1
xtt/lib/flow/src/flow_pixmap.cpp
xtt/lib/flow/src/flow_pixmap.cpp
+3
-3
No files found.
xtt/lib/flow/gtk/flow_draw_gtk.cpp
View file @
e3390825
...
...
@@ -1203,23 +1203,19 @@ void FlowDrawGtk::pixmaps_delete(void* pixmaps)
}
void
FlowDrawGtk
::
pixmap
(
int
x
,
int
y
,
flow_sPixmapData
*
pixmap_data
,
void
*
pixmaps
,
flow_eDrawType
gc_
type
,
int
idx
)
void
*
pixmaps
,
flow_eDrawType
gc_
bg
,
flow_eDrawType
gc_fg
,
int
idx
)
{
flow_sPixmapDataElem
*
pdata
=
(
flow_sPixmapDataElem
*
)
pixmap_data
+
idx
;
draw_sPixmap
*
pms
=
(
draw_sPixmap
*
)
pixmaps
;
flow_eDrawType
gc2
=
(
gc_type
==
flow_eDrawType_Line
)
?
flow_eDrawType_LineErase
:
flow_eDrawType_Line
;
gdk_draw_rectangle
(
w
->
buffer
,
gcs
[
gc
2
][
idx
],
1
,
x
,
y
,
pdata
->
width
,
pdata
->
height
);
gdk_gc_set_clip_mask
(
gcs
[
gc_
type
][
idx
],
pms
->
pixmap
[
idx
]);
gdk_gc_set_clip_origin
(
gcs
[
gc_
type
][
idx
],
x
,
y
);
gdk_draw_rectangle
(
w
->
buffer
,
gcs
[
gc_
type
][
idx
],
1
,
x
,
y
,
w
->
buffer
,
gcs
[
gc
_bg
][
idx
],
1
,
x
,
y
,
pdata
->
width
,
pdata
->
height
);
gdk_gc_set_clip_mask
(
gcs
[
gc_
fg
][
idx
],
pms
->
pixmap
[
idx
]);
gdk_gc_set_clip_origin
(
gcs
[
gc_
fg
][
idx
],
x
,
y
);
gdk_draw_rectangle
(
w
->
buffer
,
gcs
[
gc_
fg
][
idx
],
1
,
x
,
y
,
pdata
->
width
,
pdata
->
height
);
gdk_gc_set_clip_mask
(
gcs
[
gc_
type
][
idx
],
NULL
);
gdk_gc_set_clip_origin
(
gcs
[
gc_
type
][
idx
],
0
,
0
);
gdk_gc_set_clip_mask
(
gcs
[
gc_
fg
][
idx
],
NULL
);
gdk_gc_set_clip_origin
(
gcs
[
gc_
fg
][
idx
],
0
,
0
);
}
void
FlowDrawGtk
::
image
(
int
x
,
int
y
,
int
width
,
int
height
,
...
...
xtt/lib/flow/gtk/flow_draw_gtk.h
View file @
e3390825
...
...
@@ -110,7 +110,7 @@ public:
void
pixmaps_create
(
flow_sPixmapData
*
pixmap_data
,
void
**
pixmaps
);
void
pixmaps_delete
(
void
*
pixmaps
);
void
pixmap
(
int
x
,
int
y
,
flow_sPixmapData
*
pixmap_data
,
void
*
pixmaps
,
flow_eDrawType
gc_
type
,
int
idx
);
flow_eDrawType
gc_
bg
,
flow_eDrawType
gc_fg
,
int
idx
);
void
set_timer
(
FlowCtx
*
ctx
,
int
time_ms
,
void
(
*
callback_func
)(
FlowCtx
*
ctx
),
void
**
id
);
...
...
xtt/lib/flow/qt/flow_draw_qt.cqt
View file @
e3390825
...
...
@@ -966,23 +966,18 @@ void FlowDrawQt::pixmaps_delete(void* pixmaps)
delete ((draw_sPixmap*)pixmaps);
}
void FlowDrawQt::pixmap(int x, int y,
flow_sPixmapData* pixmap_data, void* pixmaps, flow_eDrawType painter_type,
int idx)
void FlowDrawQt::pixmap(int x, int y, flow_sPixmapData* pixmap_data,
void* pixmaps, flow_eDrawType gc_bg, flow_eDrawType gc_fg, int idx)
{
flow_sPixmapDataElem* pdata = (flow_sPixmapDataElem*)pixmap_data + idx;
draw_sPixmap* pms = (draw_sPixmap*)pixmaps;
flow_eDrawType gc2 = (painter_type == flow_eDrawType_Line) ?
flow_eDrawType_LineErase : flow_eDrawType_Line;
{
unique_ptr<QPainter> painter = get_painter(gc
2
, idx);
unique_ptr<QPainter> painter = get_painter(gc
_bg
, idx);
painter->fillRect(x, y, pdata->width, pdata->height, painter->brush());
}
unique_ptr<QPainter> painter = get_painter(
painter_type
, idx);
unique_ptr<QPainter> painter = get_painter(
gc_fg
, idx);
QRegion clipRegion = QRegion(pms->pixmap[idx].createMaskFromColor(Qt::black));
painter->setClipRegion(clipRegion.translated(x, y));
...
...
xtt/lib/flow/qt/flow_draw_qt.h
View file @
e3390825
...
...
@@ -100,7 +100,7 @@ public:
void
image
(
int
x
,
int
y
,
int
width
,
int
height
,
flow_tImImage
image
,
flow_tPixmap
pixmap
,
flow_tPixmap
clip_mask
);
void
pixmap
(
int
x
,
int
y
,
flow_sPixmapData
*
pixmap_data
,
void
*
pixmaps
,
flow_eDrawType
gc_
type
,
int
idx
);
void
*
pixmaps
,
flow_eDrawType
gc_
bg
,
flow_eDrawType
gc_fg
,
int
idx
);
void
pixmaps_create
(
flow_sPixmapData
*
pixmap_data
,
void
**
pixmaps
);
...
...
xtt/lib/flow/src/flow_annotpixmap.cpp
View file @
e3390825
...
...
@@ -125,7 +125,7 @@ void FlowAnnotPixmap::draw(
ctx
->
fdraw
->
pixmap
(
x
,
p
.
z_y
+
((
FlowPoint
*
)
pos
)
->
z_y
-
ctx
->
offset_y
,
&
((
FlowNode
*
)
node
)
->
annotpixmapv
[
number
]
->
pixmap_data
,
((
FlowNode
*
)
node
)
->
annotpixmapv
[
number
]
->
pixmaps
,
draw_type
,
idx
);
draw_type
,
flow_eDrawType_LineErase
,
idx
);
}
void
FlowAnnotPixmap
::
draw_inverse
(
void
*
pos
,
int
hot
,
void
*
node
)
...
...
@@ -147,8 +147,8 @@ void FlowAnnotPixmap::draw_inverse(void* pos, int hot, void* node)
x
=
p
.
z_x
+
((
FlowPoint
*
)
pos
)
->
z_x
-
ctx
->
offset_x
;
ctx
->
fdraw
->
pixmap
(
x
,
p
.
z_y
+
((
FlowPoint
*
)
pos
)
->
z_y
-
ctx
->
offset_y
,
&
((
FlowNode
*
)
node
)
->
annotpixmapv
[
number
]
->
pixmap_data
,
((
FlowNode
*
)
node
)
->
annotpixmapv
[
number
]
->
pixmaps
,
ctx
->
inverse_color
,
idx
);
((
FlowNode
*
)
node
)
->
annotpixmapv
[
number
]
->
pixmaps
,
flow_eDrawType_LineErase
,
ctx
->
inverse_color
,
idx
);
}
void
FlowAnnotPixmap
::
erase
(
void
*
pos
,
int
hot
,
void
*
node
)
...
...
@@ -186,7 +186,8 @@ void FlowAnnotPixmap::nav_draw(void* pos, int highlight, void* node)
ctx
->
fdraw
->
pixmap
(
p
.
nav_z_x
+
((
FlowPoint
*
)
pos
)
->
nav_z_x
-
ctx
->
nav_offset_x
,
p
.
nav_z_y
+
((
FlowPoint
*
)
pos
)
->
nav_z_y
-
ctx
->
nav_offset_y
,
&
((
FlowNode
*
)
node
)
->
annotpixmapv
[
number
]
->
pixmap_data
,
((
FlowNode
*
)
node
)
->
annotpixmapv
[
number
]
->
pixmaps
,
draw_type
,
idx
);
((
FlowNode
*
)
node
)
->
annotpixmapv
[
number
]
->
pixmaps
,
draw_type
,
flow_eDrawType_LineErase
,
idx
);
}
void
FlowAnnotPixmap
::
nav_erase
(
void
*
pos
,
void
*
node
)
...
...
xtt/lib/flow/src/flow_draw.h
View file @
e3390825
...
...
@@ -76,7 +76,7 @@ public:
virtual
void
image
(
int
x
,
int
y
,
int
width
,
int
height
,
flow_tImImage
image
,
flow_tPixmap
pixmap
,
flow_tPixmap
clip_mask
)
=
0
;
virtual
void
pixmap
(
int
x
,
int
y
,
flow_sPixmapData
*
pixmap_data
,
void
*
pixmaps
,
flow_eDrawType
gc_
type
,
int
idx
)
=
0
;
void
*
pixmaps
,
flow_eDrawType
gc_
bg
,
flow_eDrawType
gc_fg
,
int
idx
)
=
0
;
virtual
void
pixmaps_create
(
flow_sPixmapData
*
pixmap_data
,
void
**
pixmaps
)
=
0
;
virtual
void
pixmaps_delete
(
void
*
pixmaps
)
=
0
;
...
...
xtt/lib/flow/src/flow_pixmap.cpp
View file @
e3390825
...
...
@@ -107,7 +107,7 @@ void FlowPixmap::draw(void* pos, int highlight, int dimmed, int hot, void* node)
idx
=
MIN
(
idx
,
DRAW_TYPE_SIZE
-
1
);
ctx
->
fdraw
->
pixmap
(
p
.
z_x
+
((
FlowPoint
*
)
pos
)
->
z_x
-
ctx
->
offset_x
,
p
.
z_y
+
((
FlowPoint
*
)
pos
)
->
z_y
-
ctx
->
offset_y
,
&
pixmap_data
,
pixmaps
,
flow_eDrawType_LineErase
,
idx
);
draw_type
,
flow_eDrawType_LineErase
,
idx
);
}
void
FlowPixmap
::
draw_inverse
(
void
*
pos
,
int
hot
,
void
*
node
)
...
...
@@ -119,7 +119,7 @@ void FlowPixmap::draw_inverse(void* pos, int hot, void* node)
idx
=
MIN
(
idx
,
DRAW_TYPE_SIZE
-
1
);
ctx
->
fdraw
->
pixmap
(
p
.
z_x
+
((
FlowPoint
*
)
pos
)
->
z_x
-
ctx
->
offset_x
,
p
.
z_y
+
((
FlowPoint
*
)
pos
)
->
z_y
-
ctx
->
offset_y
,
&
pixmap_data
,
pixmaps
,
flow_eDrawType_Line
,
idx
);
flow_eDrawType_Line
Erase
,
draw_type
,
idx
);
}
void
FlowPixmap
::
erase
(
void
*
pos
,
int
hot
,
void
*
node
)
...
...
@@ -144,7 +144,7 @@ void FlowPixmap::nav_draw(void* pos, int highlight, void* node)
idx
=
MIN
(
idx
,
DRAW_TYPE_SIZE
-
1
);
ctx
->
fdraw
->
pixmap
(
p
.
nav_z_x
+
((
FlowPoint
*
)
pos
)
->
nav_z_x
-
ctx
->
nav_offset_x
,
p
.
nav_z_y
+
((
FlowPoint
*
)
pos
)
->
nav_z_y
-
ctx
->
nav_offset_y
,
&
pixmap_data
,
pixmaps
,
draw_type
,
idx
);
pixmaps
,
draw_type
,
flow_eDrawType_LineErase
,
idx
);
}
void
FlowPixmap
::
nav_erase
(
void
*
pos
,
void
*
node
)
...
...
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