Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
8b5ee898
Commit
8b5ee898
authored
Jun 23, 2018
by
Davis King
Browse files
Made overlay_line use dpoints instead of point and also made it render the line
from the middle of the pixel.
parent
92a89bce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
dlib/gui_widgets/widgets.cpp
dlib/gui_widgets/widgets.cpp
+2
-2
dlib/gui_widgets/widgets.h
dlib/gui_widgets/widgets.h
+3
-3
dlib/gui_widgets/widgets_abstract.h
dlib/gui_widgets/widgets_abstract.h
+4
-4
No files found.
dlib/gui_widgets/widgets.cpp
View file @
8b5ee898
...
...
@@ -6375,8 +6375,8 @@ namespace dlib
for
(
unsigned
long
i
=
0
;
i
<
overlay_lines
.
size
();
++
i
)
{
draw_line
(
c
,
zoom_in_scale
*
overlay_lines
[
i
].
p1
/
zoom_out_scale
+
origin
,
zoom_in_scale
*
overlay_lines
[
i
].
p2
/
zoom_out_scale
+
origin
,
zoom_in_scale
*
(
overlay_lines
[
i
].
p1
+
dpoint
(
0.5
,
0.5
))
/
zoom_out_scale
+
origin
,
zoom_in_scale
*
(
overlay_lines
[
i
].
p2
+
dpoint
(
0.5
,
0.5
))
/
zoom_out_scale
+
origin
,
overlay_lines
[
i
].
color
,
area
);
}
...
...
dlib/gui_widgets/widgets.h
View file @
8b5ee898
...
...
@@ -3337,11 +3337,11 @@ namespace dlib
overlay_line
()
{
assign_pixel
(
color
,
0
);}
template
<
typename
pixel_type
>
overlay_line
(
const
point
&
p1_
,
const
point
&
p2_
,
pixel_type
p
)
overlay_line
(
const
d
point
&
p1_
,
const
d
point
&
p2_
,
pixel_type
p
)
:
p1
(
p1_
),
p2
(
p2_
)
{
assign_pixel
(
color
,
p
);
}
point
p1
;
point
p2
;
d
point
p1
;
d
point
p2
;
rgb_alpha_pixel
color
;
};
...
...
dlib/gui_widgets/widgets_abstract.h
View file @
8b5ee898
...
...
@@ -2489,8 +2489,8 @@ namespace dlib
its two end points (p1 and p2) as well as a color.
!*/
point
p1
;
point
p2
;
d
point
p1
;
d
point
p2
;
rgb_alpha_pixel
color
;
overlay_line
(
...
...
@@ -2504,8 +2504,8 @@ namespace dlib
template
<
typename
pixel_type
>
overlay_line
(
const
point
&
p1_
,
const
point
&
p2_
,
const
d
point
&
p1_
,
const
d
point
&
p2_
,
pixel_type
p
);
/*!
...
...
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