Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
8b5ee898
Commit
8b5ee898
authored
Jun 23, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made overlay_line use dpoints instead of point and also made it render the line
from the middle of the pixel.
parent
92a89bce
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
widgets.cpp
dlib/gui_widgets/widgets.cpp
+2
-2
widgets.h
dlib/gui_widgets/widgets.h
+3
-3
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
...
@@ -6375,8 +6375,8 @@ namespace dlib
for
(
unsigned
long
i
=
0
;
i
<
overlay_lines
.
size
();
++
i
)
for
(
unsigned
long
i
=
0
;
i
<
overlay_lines
.
size
();
++
i
)
{
{
draw_line
(
c
,
draw_line
(
c
,
zoom_in_scale
*
overlay_lines
[
i
].
p1
/
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
/
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
);
overlay_lines
[
i
].
color
,
area
);
}
}
...
...
dlib/gui_widgets/widgets.h
View file @
8b5ee898
...
@@ -3337,11 +3337,11 @@ namespace dlib
...
@@ -3337,11 +3337,11 @@ namespace dlib
overlay_line
()
{
assign_pixel
(
color
,
0
);}
overlay_line
()
{
assign_pixel
(
color
,
0
);}
template
<
typename
pixel_type
>
template
<
typename
pixel_type
>
overlay_line
(
const
point
&
p1_
,
const
point
&
p2_
,
pixel_type
p
)
overlay_line
(
const
dpoint
&
p1_
,
const
d
point
&
p2_
,
pixel_type
p
)
:
p1
(
p1_
),
p2
(
p2_
)
{
assign_pixel
(
color
,
p
);
}
:
p1
(
p1_
),
p2
(
p2_
)
{
assign_pixel
(
color
,
p
);
}
point
p1
;
d
point
p1
;
point
p2
;
d
point
p2
;
rgb_alpha_pixel
color
;
rgb_alpha_pixel
color
;
};
};
...
...
dlib/gui_widgets/widgets_abstract.h
View file @
8b5ee898
...
@@ -2489,8 +2489,8 @@ namespace dlib
...
@@ -2489,8 +2489,8 @@ namespace dlib
its two end points (p1 and p2) as well as a color.
its two end points (p1 and p2) as well as a color.
!*/
!*/
point
p1
;
d
point
p1
;
point
p2
;
d
point
p2
;
rgb_alpha_pixel
color
;
rgb_alpha_pixel
color
;
overlay_line
(
overlay_line
(
...
@@ -2504,8 +2504,8 @@ namespace dlib
...
@@ -2504,8 +2504,8 @@ namespace dlib
template
<
typename
pixel_type
>
template
<
typename
pixel_type
>
overlay_line
(
overlay_line
(
const
point
&
p1_
,
const
d
point
&
p1_
,
const
point
&
p2_
,
const
d
point
&
p2_
,
pixel_type
p
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