Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
64122ae0
Commit
64122ae0
authored
Jul 16, 2013
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stroked lines in Cairo GAL are always drawn at least 1 pixel wide.
parent
9374d642
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
cairo_gal.cpp
common/gal/cairo/cairo_gal.cpp
+14
-2
No files found.
common/gal/cairo/cairo_gal.cpp
View file @
64122ae0
...
@@ -496,7 +496,12 @@ void CAIRO_GAL::SetLineWidth( double aLineWidth )
...
@@ -496,7 +496,12 @@ void CAIRO_GAL::SetLineWidth( double aLineWidth )
storePath
();
storePath
();
lineWidth
=
aLineWidth
;
lineWidth
=
aLineWidth
;
cairo_set_line_width
(
cairoImage
,
aLineWidth
);
// Make lines appear at least 1 pixel wide, no matter of zoom
double
x
=
1.0
,
y
=
1.0
;
cairo_device_to_user_distance
(
cairoImage
,
&
x
,
&
y
);
double
minWidth
=
std
::
min
(
fabs
(
x
),
fabs
(
y
)
);
cairo_set_line_width
(
cairoImage
,
std
::
max
(
aLineWidth
,
minWidth
)
);
if
(
isGrouping
)
if
(
isGrouping
)
{
{
...
@@ -716,9 +721,16 @@ void CAIRO_GAL::DrawGroup( int aGroupNumber )
...
@@ -716,9 +721,16 @@ void CAIRO_GAL::DrawGroup( int aGroupNumber )
break
;
break
;
case
CMD_SET_LINE_WIDTH
:
case
CMD_SET_LINE_WIDTH
:
cairo_set_line_width
(
cairoImage
,
it
->
arguments
[
0
]
);
{
// Make lines appear at least 1 pixel wide, no matter of zoom
double
x
=
1.0
,
y
=
1.0
;
cairo_device_to_user_distance
(
cairoImage
,
&
x
,
&
y
);
double
minWidth
=
std
::
min
(
fabs
(
x
),
fabs
(
y
)
);
cairo_set_line_width
(
cairoImage
,
std
::
max
(
it
->
arguments
[
0
],
minWidth
)
);
}
break
;
break
;
case
CMD_STROKE_PATH
:
case
CMD_STROKE_PATH
:
cairo_set_source_rgb
(
cairoImage
,
strokeColor
.
r
,
strokeColor
.
g
,
strokeColor
.
b
);
cairo_set_source_rgb
(
cairoImage
,
strokeColor
.
r
,
strokeColor
.
g
,
strokeColor
.
b
);
cairo_append_path
(
cairoImage
,
it
->
cairoPath
);
cairo_append_path
(
cairoImage
,
it
->
cairoPath
);
...
...
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