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
8e74db9c
Commit
8e74db9c
authored
Apr 04, 2019
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GTK: Minor optimization of subwindow drawing.
parent
7df9937e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
23 deletions
+23
-23
xtt/lib/glow/gtk/glow_draw_gtk.cpp
xtt/lib/glow/gtk/glow_draw_gtk.cpp
+7
-5
xtt/lib/glow/gtk/glow_draw_gtk.h
xtt/lib/glow/gtk/glow_draw_gtk.h
+1
-1
xtt/lib/glow/qt/glow_draw_qt.cqt
xtt/lib/glow/qt/glow_draw_qt.cqt
+1
-1
xtt/lib/glow/qt/glow_draw_qt.h
xtt/lib/glow/qt/glow_draw_qt.h
+1
-1
xtt/lib/glow/src/glow_draw.h
xtt/lib/glow/src/glow_draw.h
+1
-1
xtt/lib/glow/src/glow_growctx.cpp
xtt/lib/glow/src/glow_growctx.cpp
+8
-14
xtt/lib/glow/src/glow_growwindow.cpp
xtt/lib/glow/src/glow_growwindow.cpp
+4
-0
No files found.
xtt/lib/glow/gtk/glow_draw_gtk.cpp
View file @
8e74db9c
...
...
@@ -1216,12 +1216,14 @@ int GlowDrawGtk::begin(DrawWind *w) {
return
0
;
}
void
GlowDrawGtk
::
end
()
{
int
width
,
height
;
gdk_drawable_get_size
(
w
->
buffer
,
&
width
,
&
height
);
void
GlowDrawGtk
::
end
(
bool
flush
)
{
if
(
flush
)
{
int
width
,
height
;
gdk_drawable_get_size
(
w
->
buffer
,
&
width
,
&
height
);
gdk_draw_drawable
(
w
->
window
,
get_gc
(
this
,
glow_eDrawType_Line
,
0
),
w
->
buffer
,
0
,
0
,
0
,
0
,
width
,
height
);
gdk_draw_drawable
(
w
->
window
,
get_gc
(
this
,
glow_eDrawType_Line
,
0
),
w
->
buffer
,
0
,
0
,
0
,
0
,
width
,
height
);
}
this
->
w
=
NULL
;
}
...
...
xtt/lib/glow/gtk/glow_draw_gtk.h
View file @
8e74db9c
...
...
@@ -114,7 +114,7 @@ public:
void
clear
();
int
begin
(
DrawWind
*
wind
);
void
end
();
void
end
(
bool
flush
=
true
);
void
get_window_size
(
DrawWind
*
w
,
int
*
width
,
int
*
height
);
void
set_window_size
(
DrawWind
*
w
,
int
width
,
int
height
);
...
...
xtt/lib/glow/qt/glow_draw_qt.cqt
View file @
8e74db9c
...
...
@@ -877,7 +877,7 @@ int GlowDrawQt::begin(DrawWind *w) {
return 0;
}
void GlowDrawQt::end() {
void GlowDrawQt::end(
bool flush
) {
this->w = NULL;
}
...
...
xtt/lib/glow/qt/glow_draw_qt.h
View file @
8e74db9c
...
...
@@ -110,7 +110,7 @@ public:
void
clear
();
int
begin
(
DrawWind
*
w
);
void
end
();
void
end
(
bool
flush
=
true
);
void
get_window_size
(
DrawWind
*
w
,
int
*
width
,
int
*
height
);
void
set_window_size
(
DrawWind
*
w
,
int
width
,
int
height
);
...
...
xtt/lib/glow/src/glow_draw.h
View file @
8e74db9c
...
...
@@ -81,7 +81,7 @@ public:
virtual
void
set_window_size
(
DrawWind
*
w
,
int
width
,
int
height
)
=
0
;
virtual
int
begin
(
DrawWind
*
wind
)
=
0
;
virtual
void
end
()
=
0
;
virtual
void
end
(
bool
flush
=
true
)
=
0
;
virtual
void
rect
(
int
x
,
int
y
,
int
width
,
int
height
,
glow_eDrawType
gc_type
,
int
fill
,
int
idx
,
int
highlight
=
0
)
=
0
;
...
...
xtt/lib/glow/src/glow_growctx.cpp
View file @
8e74db9c
...
...
@@ -168,11 +168,10 @@ void GrowCtx::set_mode(grow_eMode grow_mode)
int
GrowCtx
::
subw_event_handler
(
glow_eEvent
event
,
int
x
,
int
y
,
int
w
,
int
h
)
{
int
i
;
double
fx
,
fy
;
int
sts
;
fx
=
double
(
x
+
mw
->
offset_x
)
/
mw
->
zoom_factor_x
;
fy
=
double
(
y
+
mw
->
offset_y
)
/
mw
->
zoom_factor_y
;
double
fx
=
double
(
x
+
mw
->
offset_x
)
/
mw
->
zoom_factor_x
;
double
fy
=
double
(
y
+
mw
->
offset_y
)
/
mw
->
zoom_factor_y
;
if
(
has_subwindows
==
-
1
)
{
// Initialize
...
...
@@ -258,14 +257,10 @@ int GrowCtx::event_handler(glow_eEvent event, int x, int y, int w, int h)
{
int
sts
=
0
;
int
i
;
GlowCtx
*
ctx
;
int
node_move_event
=
0
;
double
fx
,
fy
;
ctx
=
this
;
fx
=
double
(
x
+
ctx
->
mw
->
offset_x
)
/
ctx
->
mw
->
zoom_factor_x
;
fy
=
double
(
y
+
ctx
->
mw
->
offset_y
)
/
ctx
->
mw
->
zoom_factor_y
;
double
fx
=
double
(
x
+
mw
->
offset_x
)
/
mw
->
zoom_factor_x
;
double
fy
=
double
(
y
+
mw
->
offset_y
)
/
mw
->
zoom_factor_y
;
callback_object_type
=
glow_eObjectType_NoObject
;
callback_object
=
0
;
...
...
@@ -1555,13 +1550,13 @@ int GrowCtx::event_handler(glow_eEvent event, int x, int y, int w, int h)
}
else
if
(
select_rect_active
&&
edit_mode
!=
grow_eMode_Scale
)
{
glow_eSelectPolicy
policy
;
if
(
ctx
->
select_policy
==
glow_eSelectPolicy_Both
)
{
if
(
select_policy
==
glow_eSelectPolicy_Both
)
{
if
(
x
<
select_rect_start_x
)
policy
=
glow_eSelectPolicy_Partial
;
else
policy
=
glow_eSelectPolicy_Surround
;
}
else
policy
=
ctx
->
select_policy
;
policy
=
select_policy
;
select_rect_active
=
0
;
select_rect_last_x
=
x
;
...
...
@@ -1745,12 +1740,11 @@ int GrowCtx::event_handler(glow_eEvent event, int x, int y, int w, int h)
cursor_present
=
0
;
if
(
node_movement_active
||
con_create_active
||
select_rect_active
||
node_movement_paste_active
)
{
if
(
x
<
0
||
x
>
ctx
->
mw
->
window_width
||
y
<
0
||
y
>
mw
->
window_height
)
{
if
(
x
<
0
||
x
>
mw
->
window_width
||
y
<
0
||
y
>
mw
->
window_height
)
{
/* Start auto scrolling */
auto_scrolling
(
this
);
}
}
else
if
(
x
<
0
||
x
>
ctx
->
mw
->
window_width
||
y
<
0
||
y
>
mw
->
window_height
)
}
else
if
(
x
<
0
||
x
>
mw
->
window_width
||
y
<
0
||
y
>
mw
->
window_height
)
a
.
set_hot
(
0
);
tiptext
->
remove
();
break
;
...
...
xtt/lib/glow/src/glow_growwindow.cpp
View file @
8e74db9c
...
...
@@ -323,7 +323,11 @@ void GrowWindow::draw(DrawWind* w, GlowTransform* t, int highlight, int hot,
ctx
->
gdraw
->
rect
(
ll_x
,
ll_y
,
ur_x
-
ll_x
,
ur_y
-
ll_y
,
fill_drawtype
,
1
,
0
);
ctx
->
gdraw
->
end
(
false
);
ctx
->
gdraw
->
begin
(
window_ctx
->
mw
);
window_ctx
->
draw
(
window_ctx
->
mw
,
ll_x
,
ll_y
,
ur_x
,
ur_y
);
ctx
->
gdraw
->
end
(
false
);
ctx
->
gdraw
->
begin
(
w
);
ctx
->
gdraw
->
pop_customcolors
();
}
...
...
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