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
84066f3b
Commit
84066f3b
authored
Oct 18, 2013
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xtt curve bugfix for large zooming
parent
b6babc16
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
10 deletions
+64
-10
xtt/lib/glow/gtk/glow_draw_gtk.cpp
xtt/lib/glow/gtk/glow_draw_gtk.cpp
+36
-6
xtt/lib/glow/gtk/glow_draw_gtk.h
xtt/lib/glow/gtk/glow_draw_gtk.h
+1
-0
xtt/lib/glow/src/glow_growpolyline.cpp
xtt/lib/glow/src/glow_growpolyline.cpp
+7
-1
xtt/lib/glow/src/glow_growtrend.cpp
xtt/lib/glow/src/glow_growtrend.cpp
+20
-3
No files found.
xtt/lib/glow/gtk/glow_draw_gtk.cpp
View file @
84066f3b
...
...
@@ -1574,15 +1574,16 @@ int GlowDrawGtk::polyline( GlowWind *wind, glow_sPointX *points, int point_cnt,
if
(
w
->
clip_on
)
set_clip
(
w
,
get_gc
(
this
,
gc_type
+
highlight
,
idx
));
GdkPoint
*
gpoints
=
points_to_gdk_points
(
points
,
point_cnt
);
int
cnt
;
GdkPoint
*
gpoints
=
points_to_gdk_points_curve
(
wind
,
points
,
point_cnt
,
&
cnt
);
if
(
!
w
->
draw_buffer_only
)
gdk_draw_lines
(
w
->
window
,
get_gc
(
this
,
gc_type
+
highlight
,
idx
),
gpoints
,
point_
cnt
);
gpoints
,
cnt
);
if
(
w
->
double_buffer_on
)
gdk_draw_lines
(
w
->
buffer
,
get_gc
(
this
,
gc_type
+
highlight
,
idx
),
gpoints
,
point_
cnt
);
gpoints
,
cnt
);
free
(
gpoints
);
if
(
w
->
clip_on
)
...
...
@@ -1626,15 +1627,16 @@ int GlowDrawGtk::polyline_erase( GlowWind *wind, glow_sPointX *points, int point
if
(
w
->
clip_on
)
set_clip
(
w
,
get_gc
(
this
,
glow_eDrawType_LineErase
,
idx
));
GdkPoint
*
gpoints
=
points_to_gdk_points
(
points
,
point_cnt
);
int
cnt
;
GdkPoint
*
gpoints
=
points_to_gdk_points_curve
(
wind
,
points
,
point_cnt
,
&
cnt
);
if
(
!
w
->
draw_buffer_only
)
gdk_draw_lines
(
w
->
window
,
get_gc
(
this
,
glow_eDrawType_LineErase
,
idx
),
gpoints
,
point_
cnt
);
gpoints
,
cnt
);
if
(
w
->
double_buffer_on
)
gdk_draw_lines
(
w
->
buffer
,
get_gc
(
this
,
glow_eDrawType_LineErase
,
idx
),
gpoints
,
point_
cnt
);
gpoints
,
cnt
);
free
(
gpoints
);
if
(
w
->
clip_on
)
...
...
@@ -2767,6 +2769,34 @@ GdkPoint *GlowDrawGtk::points_to_gdk_points( glow_sPointX *points, int point_cnt
return
gpoints
;
}
//
// Points outside window in x direction excluded
//
GdkPoint
*
GlowDrawGtk
::
points_to_gdk_points_curve
(
GlowWind
*
w
,
glow_sPointX
*
points
,
int
point_cnt
,
int
*
cnt
)
{
GdkPoint
*
gpoints
=
(
GdkPoint
*
)
malloc
(
point_cnt
*
sizeof
(
GdkPoint
));
int
idx
=
0
;
int
last_idx
=
0
;
for
(
int
i
=
0
;
i
<
point_cnt
;
i
++
)
{
if
(
idx
==
0
&&
i
!=
point_cnt
-
1
&&
((
points
[
i
].
x
<
0
&&
points
[
i
+
1
].
x
<
0
)
||
(
points
[
i
].
x
>
w
->
window_width
&&
points
[
i
+
1
].
x
>
w
->
window_width
)))
continue
;
if
(
idx
!=
0
&&
!
((
points
[
i
].
x
<
0
&&
points
[
i
-
1
].
x
<
0
)
||
(
points
[
i
].
x
>
w
->
window_width
&&
points
[
i
-
1
].
x
>
w
->
window_width
)))
last_idx
=
idx
;
gpoints
[
idx
].
x
=
points
[
i
].
x
;
gpoints
[
idx
].
y
=
points
[
i
].
y
;
idx
++
;
}
*
cnt
=
idx
;
if
(
last_idx
!=
0
)
*
cnt
=
last_idx
+
1
;
return
gpoints
;
}
void
GlowDrawGtk
::
load_font
(
glow_eFont
font_idx
,
int
font_type
,
int
idx
)
{
if
(
!
font
[
font_idx
][
font_type
][
idx
])
...
...
xtt/lib/glow/gtk/glow_draw_gtk.h
View file @
84066f3b
...
...
@@ -194,6 +194,7 @@ class GlowDrawGtk : public GlowDraw {
virtual
void
remove_timer
(
void
*
id
);
int
init_nav
(
GtkWidget
*
nav_widget
);
GdkPoint
*
points_to_gdk_points
(
glow_sPointX
*
points
,
int
point_cnt
);
GdkPoint
*
points_to_gdk_points_curve
(
GlowWind
*
w
,
glow_sPointX
*
points
,
int
point_cnt
,
int
*
cnt
);
int
get_font_type
(
int
gc_type
);
void
load_font
(
glow_eFont
font_idx
,
int
font_type
,
int
idx
);
...
...
xtt/lib/glow/src/glow_growpolyline.cpp
View file @
84066f3b
...
...
@@ -40,6 +40,7 @@
#include <iostream>
#include <float.h>
#include <math.h>
#include <limits.h>
#include <stdlib.h>
#include "glow_growpolyline.h"
#include "glow_draw.h"
...
...
@@ -389,6 +390,11 @@ void GrowPolyLine::draw( GlowWind *w, GlowTransform *t, int highlight, int hot,
y1
=
trf
.
y
(
t
,
((
GlowPoint
*
)
a_points
[
i
])
->
x
,
((
GlowPoint
*
)
a_points
[
i
])
->
y
);
}
if
(
x1
*
w
->
zoom_factor_x
-
w
->
offset_x
>
SHRT_MAX
)
point_p
->
x
=
SHRT_MAX
;
else
if
(
x1
*
w
->
zoom_factor_x
-
w
->
offset_x
<
SHRT_MIN
)
point_p
->
x
=
SHRT_MIN
;
else
point_p
->
x
=
int
(
x1
*
w
->
zoom_factor_x
+
0.5
)
-
w
->
offset_x
;
point_p
->
y
=
int
(
y1
*
w
->
zoom_factor_y
+
0.5
)
-
w
->
offset_y
;
point_p
++
;
...
...
xtt/lib/glow/src/glow_growtrend.cpp
View file @
84066f3b
...
...
@@ -499,8 +499,17 @@ void GrowTrend::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, voi
drawtype
=
ctx
->
get_drawtype
(
fill_drawtype
,
glow_eDrawType_FillHighlight
,
highlight
,
(
GrowNode
*
)
colornode
,
1
);
if
(
grad
==
glow_eGradient_No
)
ctx
->
gdraw
->
fill_rect
(
w
,
ll_x
,
ll_y
,
ur_x
-
ll_x
,
ur_y
-
ll_y
,
drawtype
);
if
(
grad
==
glow_eGradient_No
)
{
int
width
=
ur_x
-
ll_x
;
int
x
=
ll_x
;
if
(
x
<
0
)
{
x
=
0
;
width
+=
ll_x
;
}
if
(
ur_x
>
w
->
window_width
)
width
-=
ur_x
-
w
->
window_width
;
ctx
->
gdraw
->
fill_rect
(
w
,
x
,
ll_y
,
width
,
ur_y
-
ll_y
,
drawtype
);
}
else
{
glow_eDrawType
f1
,
f2
;
double
rotation
;
...
...
@@ -557,7 +566,15 @@ void GrowTrend::draw( GlowWind *w, GlowTransform *t, int highlight, int hot, voi
for
(
i
=
0
;
i
<
horizontal_lines
;
i
++
)
{
int
y
=
int
(
ll_y
+
double
(
ur_y
-
ll_y
)
/
(
horizontal_lines
+
1
)
*
(
i
+
1
));
ctx
->
gdraw
->
line
(
w
,
ll_x
,
y
,
ur_x
,
y
,
drawtype
,
0
,
0
);
int
width
=
ur_x
-
ll_x
;
int
x
=
ll_x
;
if
(
x
<
0
)
{
x
=
0
;
width
+=
ll_x
;
}
if
(
ur_x
>
w
->
window_width
)
width
-=
ur_x
-
w
->
window_width
;
ctx
->
gdraw
->
line
(
w
,
x
,
y
,
x
+
width
,
y
,
drawtype
,
0
,
0
);
}
if
(
fill_curve
)
...
...
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