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
c0c30a11
Commit
c0c30a11
authored
Apr 08, 2019
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed unnecessary clip_on variable.
parent
bf73f91d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
25 deletions
+10
-25
xtt/lib/glow/gtk/glow_draw_gtk.cpp
xtt/lib/glow/gtk/glow_draw_gtk.cpp
+6
-11
xtt/lib/glow/gtk/glow_draw_gtk.h
xtt/lib/glow/gtk/glow_draw_gtk.h
+1
-2
xtt/lib/glow/qt/glow_draw_qt.cqt
xtt/lib/glow/qt/glow_draw_qt.cqt
+2
-7
xtt/lib/glow/qt/glow_draw_qt.h
xtt/lib/glow/qt/glow_draw_qt.h
+1
-2
xtt/lib/glow/src/glow_draw.cpp
xtt/lib/glow/src/glow_draw.cpp
+0
-2
xtt/lib/glow/src/glow_draw.h
xtt/lib/glow/src/glow_draw.h
+0
-1
No files found.
xtt/lib/glow/gtk/glow_draw_gtk.cpp
View file @
c0c30a11
...
@@ -563,8 +563,6 @@ void GlowDrawGtk::init_nav(GtkWidget* nav_widget)
...
@@ -563,8 +563,6 @@ void GlowDrawGtk::init_nav(GtkWidget* nav_widget)
{
{
nav_wind
.
window
=
nav_widget
->
window
;
nav_wind
.
window
=
nav_widget
->
window
;
create_buffer
(
&
nav_wind
);
create_buffer
(
&
nav_wind
);
nav_wind
.
clip_cnt
=
0
;
nav_wind
.
clip_on
=
0
;
gtk_widget_modify_bg
(
nav_widget
,
GTK_STATE_NORMAL
,
&
background
);
gtk_widget_modify_bg
(
nav_widget
,
GTK_STATE_NORMAL
,
&
background
);
...
@@ -1845,15 +1843,15 @@ void GlowDrawGtk::reset_background(DrawWind* wind)
...
@@ -1845,15 +1843,15 @@ void GlowDrawGtk::reset_background(DrawWind* wind)
void
GlowDrawGtk
::
set_clip
(
GdkGC
*
gc
)
void
GlowDrawGtk
::
set_clip
(
GdkGC
*
gc
)
{
{
if
(
((
DrawWindGtk
*
)
w
)
->
clip_on
)
{
if
(
w
->
clip_cnt
>
0
)
{
gdk_gc_set_clip_rectangle
(
gc
,
gdk_gc_set_clip_rectangle
(
gc
,
&
((
DrawWindGtk
*
)
w
)
->
clip_rectangle
[
((
DrawWindGtk
*
)
w
)
->
clip_cnt
-
1
]);
&
((
DrawWindGtk
*
)
w
)
->
clip_rectangle
[
w
->
clip_cnt
-
1
]);
}
}
}
}
void
GlowDrawGtk
::
reset_clip
(
GdkGC
*
gc
)
void
GlowDrawGtk
::
reset_clip
(
GdkGC
*
gc
)
{
{
if
(
((
DrawWindGtk
*
)
w
)
->
clip_on
)
{
if
(
w
->
clip_cnt
>
0
)
{
gdk_gc_set_clip_rectangle
(
gc
,
NULL
);
gdk_gc_set_clip_rectangle
(
gc
,
NULL
);
}
}
}
}
...
@@ -1870,22 +1868,19 @@ int GlowDrawGtk::set_clip_rectangle(
...
@@ -1870,22 +1868,19 @@ int GlowDrawGtk::set_clip_rectangle(
int
x1
=
MAX
(
ll_x
,
ur_x
);
int
x1
=
MAX
(
ll_x
,
ur_x
);
int
y0
=
MIN
(
ll_y
,
ur_y
);
int
y0
=
MIN
(
ll_y
,
ur_y
);
int
y1
=
MAX
(
ll_y
,
ur_y
);
int
y1
=
MAX
(
ll_y
,
ur_y
);
if
(
w
->
clip_cnt
!=
0
)
{
if
(
w
->
clip_cnt
>
0
)
{
x0
=
MAX
(
x0
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
x
);
x0
=
MAX
(
x0
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
x
);
x1
=
MIN
(
x1
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
x
x1
=
MIN
(
x1
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
x
+
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
width
);
+
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
width
);
y0
=
MAX
(
y0
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
y
);
y0
=
MAX
(
y0
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
y
);
y1
=
MIN
(
y1
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
y
y1
=
MIN
(
y1
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
y
+
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
height
);
+
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
height
);
x0
=
(
x0
>
x1
)
?
x1
:
x0
;
y0
=
(
y0
>
y1
)
?
y1
:
y0
;
}
}
w
->
clip_rectangle
[
w
->
clip_cnt
].
x
=
x0
;
w
->
clip_rectangle
[
w
->
clip_cnt
].
x
=
x0
;
w
->
clip_rectangle
[
w
->
clip_cnt
].
y
=
y0
;
w
->
clip_rectangle
[
w
->
clip_cnt
].
y
=
y0
;
w
->
clip_rectangle
[
w
->
clip_cnt
].
width
=
x1
-
x0
;
w
->
clip_rectangle
[
w
->
clip_cnt
].
width
=
x1
-
x0
;
w
->
clip_rectangle
[
w
->
clip_cnt
].
height
=
y1
-
y0
;
w
->
clip_rectangle
[
w
->
clip_cnt
].
height
=
y1
-
y0
;
w
->
clip_cnt
++
;
w
->
clip_cnt
++
;
w
->
clip_on
=
1
;
return
1
;
return
1
;
}
}
...
@@ -2371,7 +2366,7 @@ void GlowDrawGtk::image_pixel_iter(glow_tImImage orig_image,
...
@@ -2371,7 +2366,7 @@ void GlowDrawGtk::image_pixel_iter(glow_tImImage orig_image,
void
GlowDrawGtk
::
set_cairo_clip
(
cairo_t
*
cr
)
void
GlowDrawGtk
::
set_cairo_clip
(
cairo_t
*
cr
)
{
{
if
(
w
->
clip_
on
)
{
if
(
w
->
clip_
cnt
>
0
)
{
cairo_rectangle
(
cr
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
x
,
cairo_rectangle
(
cr
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
x
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
y
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
y
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
width
,
w
->
clip_rectangle
[
w
->
clip_cnt
-
1
].
width
,
...
@@ -2382,7 +2377,7 @@ void GlowDrawGtk::set_cairo_clip(cairo_t* cr)
...
@@ -2382,7 +2377,7 @@ void GlowDrawGtk::set_cairo_clip(cairo_t* cr)
void
GlowDrawGtk
::
reset_cairo_clip
(
cairo_t
*
cr
)
void
GlowDrawGtk
::
reset_cairo_clip
(
cairo_t
*
cr
)
{
{
if
(
((
DrawWindGtk
*
)
w
)
->
clip_on
)
{
if
(
w
->
clip_cnt
>
0
)
{
cairo_reset_clip
(
cr
);
cairo_reset_clip
(
cr
);
}
}
}
}
...
...
xtt/lib/glow/gtk/glow_draw_gtk.h
View file @
c0c30a11
...
@@ -59,7 +59,7 @@ public:
...
@@ -59,7 +59,7 @@ public:
window_width
=
window_height
=
0
;
window_width
=
window_height
=
0
;
subwindow_x
=
subwindow_y
=
0
;
subwindow_x
=
subwindow_y
=
0
;
subwindow_scale
=
1
;
subwindow_scale
=
1
;
clip_cnt
=
clip_on
=
0
;
clip_cnt
=
0
;
memset
(
clip_rectangle
,
0
,
sizeof
(
clip_rectangle
));
memset
(
clip_rectangle
,
0
,
sizeof
(
clip_rectangle
));
}
}
GdkWindow
*
window
=
NULL
;
GdkWindow
*
window
=
NULL
;
...
@@ -69,7 +69,6 @@ public:
...
@@ -69,7 +69,6 @@ public:
DrawWind
*
copy
()
{
DrawWind
*
copy
()
{
DrawWindGtk
*
tmp
=
new
DrawWindGtk
();
DrawWindGtk
*
tmp
=
new
DrawWindGtk
();
tmp
->
clip_on
=
this
->
clip_on
;
tmp
->
clip_cnt
=
this
->
clip_cnt
;
tmp
->
clip_cnt
=
this
->
clip_cnt
;
tmp
->
window
=
this
->
window
;
tmp
->
window
=
this
->
window
;
tmp
->
buffer
=
this
->
buffer
;
tmp
->
buffer
=
this
->
buffer
;
...
...
xtt/lib/glow/qt/glow_draw_qt.cqt
View file @
c0c30a11
...
@@ -174,7 +174,7 @@ unique_ptr<QPainter> GlowDrawQt::get_painter(QPaintDevice* window,
...
@@ -174,7 +174,7 @@ unique_ptr<QPainter> GlowDrawQt::get_painter(QPaintDevice* window,
painter->setPen(QPen(painter->brush(), size + 1));
painter->setPen(QPen(painter->brush(), size + 1));
}
}
if (w && w->clip_
on
) {
if (w && w->clip_
cnt > 0
) {
painter->setClipRect(w->clip_rectangle[w->clip_cnt - 1]);
painter->setClipRect(w->clip_rectangle[w->clip_cnt - 1]);
painter->setClipping(true);
painter->setClipping(true);
}
}
...
@@ -239,8 +239,6 @@ void GlowDrawQt::init_nav(QWidget* nav_widget)
...
@@ -239,8 +239,6 @@ void GlowDrawQt::init_nav(QWidget* nav_widget)
assert(dynamic_cast<QtScrollWidgetGlow*>(nav_widget) != NULL);
assert(dynamic_cast<QtScrollWidgetGlow*>(nav_widget) != NULL);
nav_wind.window = dynamic_cast<QtScrollWidgetGlow*>(nav_widget);
nav_wind.window = dynamic_cast<QtScrollWidgetGlow*>(nav_widget);
nav_wind.buffer = &(dynamic_cast<QtScrollWidgetGlow*>(nav_widget)->image);
nav_wind.buffer = &(dynamic_cast<QtScrollWidgetGlow*>(nav_widget)->image);
nav_wind.clip_cnt = 0;
nav_wind.clip_on = 0;
QPalette pal;
QPalette pal;
pal.setColor(QPalette::Background, background);
pal.setColor(QPalette::Background, background);
...
@@ -1386,22 +1384,19 @@ int GlowDrawQt::set_clip_rectangle(
...
@@ -1386,22 +1384,19 @@ int GlowDrawQt::set_clip_rectangle(
int x1 = MAX(ll_x, ur_x);
int x1 = MAX(ll_x, ur_x);
int y0 = MIN(ll_y, ur_y);
int y0 = MIN(ll_y, ur_y);
int y1 = MAX(ll_y, ur_y);
int y1 = MAX(ll_y, ur_y);
if (w->clip_cnt
!=
0) {
if (w->clip_cnt
>
0) {
x0 = MAX(x0, w->clip_rectangle[w->clip_cnt - 1].x());
x0 = MAX(x0, w->clip_rectangle[w->clip_cnt - 1].x());
x1 = MIN(x1, w->clip_rectangle[w->clip_cnt - 1].x()
x1 = MIN(x1, w->clip_rectangle[w->clip_cnt - 1].x()
+ w->clip_rectangle[w->clip_cnt - 1].width());
+ w->clip_rectangle[w->clip_cnt - 1].width());
y0 = MAX(y0, w->clip_rectangle[w->clip_cnt - 1].y());
y0 = MAX(y0, w->clip_rectangle[w->clip_cnt - 1].y());
y1 = MIN(y1, w->clip_rectangle[w->clip_cnt - 1].y()
y1 = MIN(y1, w->clip_rectangle[w->clip_cnt - 1].y()
+ w->clip_rectangle[w->clip_cnt - 1].height());
+ w->clip_rectangle[w->clip_cnt - 1].height());
x0 = (x0 > x1) ? x1 : x0;
y0 = (y0 > y1) ? y1 : y0;
}
}
w->clip_rectangle[w->clip_cnt].setX(x0);
w->clip_rectangle[w->clip_cnt].setX(x0);
w->clip_rectangle[w->clip_cnt].setY(y0);
w->clip_rectangle[w->clip_cnt].setY(y0);
w->clip_rectangle[w->clip_cnt].setWidth(x1 - x0);
w->clip_rectangle[w->clip_cnt].setWidth(x1 - x0);
w->clip_rectangle[w->clip_cnt].setHeight(y1 - y0);
w->clip_rectangle[w->clip_cnt].setHeight(y1 - y0);
w->clip_cnt++;
w->clip_cnt++;
w->clip_on = 1;
return 1;
return 1;
}
}
...
...
xtt/lib/glow/qt/glow_draw_qt.h
View file @
c0c30a11
...
@@ -65,7 +65,7 @@ public:
...
@@ -65,7 +65,7 @@ public:
window_width
=
window_height
=
0
;
window_width
=
window_height
=
0
;
subwindow_x
=
subwindow_y
=
0
;
subwindow_x
=
subwindow_y
=
0
;
subwindow_scale
=
1
;
subwindow_scale
=
1
;
clip_cnt
=
clip_on
=
0
;
clip_cnt
=
0
;
memset
(
clip_rectangle
,
0
,
sizeof
(
clip_rectangle
));
memset
(
clip_rectangle
,
0
,
sizeof
(
clip_rectangle
));
}
}
...
@@ -76,7 +76,6 @@ public:
...
@@ -76,7 +76,6 @@ public:
DrawWind
*
copy
()
{
DrawWind
*
copy
()
{
DrawWindQt
*
tmp
=
new
DrawWindQt
();
DrawWindQt
*
tmp
=
new
DrawWindQt
();
tmp
->
clip_on
=
this
->
clip_on
;
tmp
->
clip_cnt
=
this
->
clip_cnt
;
tmp
->
clip_cnt
=
this
->
clip_cnt
;
tmp
->
window
=
this
->
window
;
tmp
->
window
=
this
->
window
;
tmp
->
buffer
=
this
->
buffer
;
tmp
->
buffer
=
this
->
buffer
;
...
...
xtt/lib/glow/src/glow_draw.cpp
View file @
c0c30a11
...
@@ -53,8 +53,6 @@ void GlowDraw::reset_clip_rectangle(DrawWind* w)
...
@@ -53,8 +53,6 @@ void GlowDraw::reset_clip_rectangle(DrawWind* w)
return
;
return
;
}
}
w
->
clip_cnt
--
;
w
->
clip_cnt
--
;
if
(
w
->
clip_cnt
==
0
)
w
->
clip_on
=
0
;
}
}
glow_eGradient
GlowDraw
::
gradient_rotate
(
double
rot
,
glow_eGradient
gradient
)
glow_eGradient
GlowDraw
::
gradient_rotate
(
double
rot
,
glow_eGradient
gradient
)
...
...
xtt/lib/glow/src/glow_draw.h
View file @
c0c30a11
...
@@ -58,7 +58,6 @@ public:
...
@@ -58,7 +58,6 @@ public:
int
subwindow_x
;
//!< Subwindow x coordinate in pixel.
int
subwindow_x
;
//!< Subwindow x coordinate in pixel.
int
subwindow_y
;
//!< Subwindow y coordinate in pixel.
int
subwindow_y
;
//!< Subwindow y coordinate in pixel.
double
subwindow_scale
;
//!< Subwindow scale.
double
subwindow_scale
;
//!< Subwindow scale.
int
clip_on
=
0
;
int
clip_cnt
=
0
;
int
clip_cnt
=
0
;
virtual
DrawWind
*
copy
()
=
0
;
virtual
DrawWind
*
copy
()
=
0
;
...
...
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