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
3aacbb71
Commit
3aacbb71
authored
Jun 23, 2005
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Position correction at rotation
parent
69ea452c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
50 deletions
+74
-50
xtt/lib/glow/src/glow_growannot.cpp
xtt/lib/glow/src/glow_growannot.cpp
+74
-50
No files found.
xtt/lib/glow/src/glow_growannot.cpp
View file @
3aacbb71
...
@@ -65,6 +65,7 @@ void GrowAnnot::draw( GlowTransform *t, int highlight, int hot, void *node,
...
@@ -65,6 +65,7 @@ void GrowAnnot::draw( GlowTransform *t, int highlight, int hot, void *node,
return
;
return
;
glow_eDrawType
color
;
glow_eDrawType
color
;
int
rot
;
double
trf_scale
=
trf
.
vertical_scale
(
t
);
double
trf_scale
=
trf
.
vertical_scale
(
t
);
int
idx
=
int
(
trf_scale
*
ctx
->
zoom_factor_y
/
ctx
->
base_zoom_factor
*
(
text_size
+
4
)
-
4
);
int
idx
=
int
(
trf_scale
*
ctx
->
zoom_factor_y
/
ctx
->
base_zoom_factor
*
(
text_size
+
4
)
-
4
);
if
(
idx
<
0
)
if
(
idx
<
0
)
...
@@ -75,76 +76,99 @@ void GrowAnnot::draw( GlowTransform *t, int highlight, int hot, void *node,
...
@@ -75,76 +76,99 @@ void GrowAnnot::draw( GlowTransform *t, int highlight, int hot, void *node,
{
{
x1
=
int
(
trf
.
x
(
p
.
x
,
p
.
y
)
*
ctx
->
zoom_factor_x
)
-
ctx
->
offset_x
;
x1
=
int
(
trf
.
x
(
p
.
x
,
p
.
y
)
*
ctx
->
zoom_factor_x
)
-
ctx
->
offset_x
;
y1
=
int
(
trf
.
y
(
p
.
x
,
p
.
y
)
*
ctx
->
zoom_factor_y
)
-
ctx
->
offset_y
;
y1
=
int
(
trf
.
y
(
p
.
x
,
p
.
y
)
*
ctx
->
zoom_factor_y
)
-
ctx
->
offset_y
;
rot
=
(
int
)
trf
.
rot
();
}
}
else
else
{
{
x1
=
int
(
trf
.
x
(
t
,
p
.
x
,
p
.
y
)
*
ctx
->
zoom_factor_x
)
-
ctx
->
offset_x
;
x1
=
int
(
trf
.
x
(
t
,
p
.
x
,
p
.
y
)
*
ctx
->
zoom_factor_x
)
-
ctx
->
offset_x
;
y1
=
int
(
trf
.
y
(
t
,
p
.
x
,
p
.
y
)
*
ctx
->
zoom_factor_y
)
-
ctx
->
offset_y
;
y1
=
int
(
trf
.
y
(
t
,
p
.
x
,
p
.
y
)
*
ctx
->
zoom_factor_y
)
-
ctx
->
offset_y
;
rot
=
(
int
)
trf
.
rot
(
t
);
}
}
rot
=
rot
<
0
?
rot
%
360
+
360
:
rot
%
360
;
switch
(
annot_type
)
{
switch
(
annot_type
)
{
case
glow_eAnnotType_OneLine
:
case
glow_eAnnotType_OneLine
:
{
color
=
((
GrowCtx
*
)
ctx
)
->
get_drawtype
(
color_drawtype
,
glow_eDrawType_LineHighlight
,
int
width
,
height
,
descent
;
highlight
,
(
GrowNode
*
)
colornode
,
2
);
color
=
((
GrowCtx
*
)
ctx
)
->
get_drawtype
(
color_drawtype
,
glow_eDrawType_LineHighlight
,
highlight
,
(
GrowNode
*
)
colornode
,
2
);
if
(
rot
<
45
||
rot
>=
315
)
{
if
(
((
GlowNode
*
)
node
)
->
annotv_inputmode
[
number
]
&&
if
(
((
GlowNode
*
)
node
)
->
annotv_inputmode
[
number
]
&&
((
GrowNode
*
)
node
)
->
input_selected
)
{
((
GrowNode
*
)
node
)
->
input_selected
)
{
int
width
,
height
,
descent
;
draw_get_text_extent
(
ctx
,
((
GlowNode
*
)
node
)
->
annotv
[
number
],
draw_get_text_extent
(
ctx
,
((
GlowNode
*
)
node
)
->
annotv
[
number
],
strlen
(((
GlowNode
*
)
node
)
->
annotv
[
number
]),
strlen
(((
GlowNode
*
)
node
)
->
annotv
[
number
]),
draw_type
,
idx
,
draw_type
,
idx
,
&
width
,
&
height
,
&
descent
);
&
width
,
&
height
,
&
descent
);
glow_draw_fill_rect
(
ctx
,
x1
,
y1
-
height
+
descent
,
width
,
height
,
glow_eDrawType_MediumGray
);
glow_draw_fill_rect
(
ctx
,
x1
,
y1
-
height
+
descent
,
width
,
height
,
glow_eDrawType_MediumGray
);
}
}
}
glow_draw_text
(
ctx
,
x1
,
y1
,
else
{
((
GlowNode
*
)
node
)
->
annotv
[
number
],
// Text is rotated, adjust the coordinates
strlen
(((
GlowNode
*
)
node
)
->
annotv
[
number
]),
draw_type
,
color
,
idx
,
draw_get_text_extent
(
ctx
,
((
GlowNode
*
)
node
)
->
annotv
[
number
],
highlight
,
0
);
strlen
(((
GlowNode
*
)
node
)
->
annotv
[
number
]),
if
(
((
GlowNode
*
)
node
)
->
annotv_inputmode
[
number
])
draw_type
,
idx
,
glow_draw_text_cursor
(
ctx
,
x1
,
y1
,
&
width
,
&
height
,
&
descent
);
((
GlowNode
*
)
node
)
->
annotv
[
number
],
strlen
(((
GlowNode
*
)
node
)
->
annotv
[
number
]),
if
(
45
<=
rot
&&
rot
<
135
)
{
draw_type
,
color
,
idx
,
highlight
,
y1
+=
height
-
descent
;
((
GrowNode
*
)
node
)
->
input_position
);
}
else
if
(
135
<=
rot
&&
rot
<
225
)
{
x1
-=
width
;
y1
+=
height
-
descent
;
}
else
{
x1
-=
width
;
}
}
glow_draw_text
(
ctx
,
x1
,
y1
,
((
GlowNode
*
)
node
)
->
annotv
[
number
],
strlen
(((
GlowNode
*
)
node
)
->
annotv
[
number
]),
draw_type
,
color
,
idx
,
highlight
,
0
);
if
(
((
GlowNode
*
)
node
)
->
annotv_inputmode
[
number
])
glow_draw_text_cursor
(
ctx
,
x1
,
y1
,
((
GlowNode
*
)
node
)
->
annotv
[
number
],
strlen
(((
GlowNode
*
)
node
)
->
annotv
[
number
]),
draw_type
,
color
,
idx
,
highlight
,
((
GrowNode
*
)
node
)
->
input_position
);
#if 0
#if 0
glow_draw_move_input( ctx,
glow_draw_move_input( ctx,
((GlowNode *) node)->annotv_input[number],
((GlowNode *) node)->annotv_input[number],
x1, y1,
x1, y1,
glow_ePosition_Absolute);
glow_ePosition_Absolute);
#endif
#endif
break
;
break
;
case
glow_eAnnotType_MultiLine
:
}
{
case
glow_eAnnotType_MultiLine
:
{
int
z_width
,
z_height
,
z_descent
;
int
z_width
,
z_height
,
z_descent
;
int
len
=
0
;
int
len
=
0
;
int
line_cnt
=
0
;
int
line_cnt
=
0
;
char
*
line
=
((
GlowNode
*
)
node
)
->
annotv
[
number
];
char
*
line
=
((
GlowNode
*
)
node
)
->
annotv
[
number
];
char
*
s
;
char
*
s
;
color
=
((
GrowCtx
*
)
ctx
)
->
get_drawtype
(
color_drawtype
,
glow_eDrawType_LineHighlight
,
color
=
((
GrowCtx
*
)
ctx
)
->
get_drawtype
(
color_drawtype
,
glow_eDrawType_LineHighlight
,
highlight
,
(
GrowNode
*
)
colornode
,
2
);
highlight
,
(
GrowNode
*
)
colornode
,
2
);
draw_get_text_extent
(
ctx
,
""
,
0
,
draw_type
,
idx
,
&
z_width
,
&
z_height
,
draw_get_text_extent
(
ctx
,
""
,
0
,
draw_type
,
idx
,
&
z_width
,
&
z_height
,
&
z_descent
);
&
z_descent
);
for
(
s
=
((
GlowNode
*
)
node
)
->
annotv
[
number
];
*
s
;
s
++
)
for
(
s
=
((
GlowNode
*
)
node
)
->
annotv
[
number
];
*
s
;
s
++
)
{
{
if
(
*
s
==
10
)
{
if
(
*
s
==
10
)
if
(
len
)
{
glow_draw_text
(
ctx
,
x1
,
y1
+
line_cnt
*
z_height
,
line
,
if
(
len
)
len
,
draw_type
,
color
,
idx
,
highlight
,
0
);
glow_draw_text
(
ctx
,
x1
,
y1
+
line_cnt
*
z_height
,
line
,
len
=
0
;
len
,
draw_type
,
color
,
idx
,
highlight
,
0
);
line
=
s
+
1
;
len
=
0
;
line_cnt
++
;
line
=
s
+
1
;
line_cnt
++
;
}
else
len
++
;
}
}
if
(
len
)
else
glow_draw_text
(
ctx
,
x1
,
y1
+
line_cnt
*
z_height
,
line
,
len
++
;
len
,
draw_type
,
color
,
idx
,
highlight
,
0
);
break
;
}
}
if
(
len
)
glow_draw_text
(
ctx
,
x1
,
y1
+
line_cnt
*
z_height
,
line
,
len
,
draw_type
,
color
,
idx
,
highlight
,
0
);
break
;
}
}
}
}
}
...
...
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