diff options
| author | David Mathog <> | 2013-03-21 14:07:06 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2013-03-21 14:07:06 +0000 |
| commit | a2dc24e823a4e36b1a7551e87108c011e47df971 (patch) | |
| tree | bdbc991c585152842f8b139cf9777a88c42147e0 /src/extension/internal/emf-print.cpp | |
| parent | INX: fix typo in internal WMF input/output filetypename (diff) | |
| download | inkscape-a2dc24e823a4e36b1a7551e87108c011e47df971.tar.gz inkscape-a2dc24e823a4e36b1a7551e87108c011e47df971.zip | |
988601-changes_2013_03_20a.patch
1. Fixes the clang warnings noted in a post above, other than those
associated with alignment caused by casting.
2. Fixes some minor rounding errors in both WMF and EMF input/output.
Round trip open/save cycles are conservative for EMF and WMF files
(excluding any features that are not full supported in inkscape or the
target file format, for instance, gradients, which must be emulated.)
3. Fixed a missing break in the input WMF LINETO record handling, which
was falling through into the MOVETO and generating a harmless extra "M"
operation in a path.
4. WMF has no POLYPOLYLINE record. However input that maps into
essentially a polypolyline record in SVG is common, for instance dashed
lines that have been converted to line segments. These end up in SVG as
a series of M L M L draw commands in the path. Earlier each M L pair
was going out as a polyline record, now they go as a series of
MOVETO/LINETO records. The primary reason for this change is that
without this change the behavior described in (2) does not occur.
5. Fixed an issue where polyline and polygon records in some instances
ended up with an extra copy of their last point.
(bzr r11668.1.62)
Diffstat (limited to 'src/extension/internal/emf-print.cpp')
| -rw-r--r-- | src/extension/internal/emf-print.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp index 3296a1be6..2a9f734d1 100644 --- a/src/extension/internal/emf-print.cpp +++ b/src/extension/internal/emf-print.cpp @@ -972,7 +972,7 @@ int PrintEmf::create_pen(SPStyle const *style, const Geom::Affine &transform) double scale = sqrt( (p[X]*p[X]) + (p[Y]*p[Y]) ) / sqrt(2); if(!style->stroke_width.computed){return 0;} //if width is 0 do not (reset) the pen, it should already be NULL_PEN - uint32_t linewidth = MAX( 1, (uint32_t) (scale * style->stroke_width.computed * PX2WORLD) ); + uint32_t linewidth = MAX( 1, (uint32_t) round(scale * style->stroke_width.computed * PX2WORLD) ); if ( style->stroke_linecap.computed == 0){ linecap = U_PS_ENDCAP_FLAT; } else if (style->stroke_linecap.computed == 1){ linecap = U_PS_ENDCAP_ROUND; } @@ -1516,13 +1516,8 @@ bool PrintEmf::print_simple_shape(Geom::PathVector const &pathv, const Geom::Aff { nodes++; - if ( is_straight_curve(*cit) ) { - lines++; - } - else if (Geom::CubicBezier const *cubic = dynamic_cast<Geom::CubicBezier const*>(&*cit)) { - cubic = cubic; - curves++; - } + if ( is_straight_curve(*cit) ) { lines++; } + else if(&*cit) { curves++; } } } @@ -2044,8 +2039,8 @@ unsigned int PrintEmf::text(Inkscape::Extension::Print * /*mod*/, char const *te U_LOGFONT lf = logfont_set( textheight, 0, - rot, - rot, + round(rot), + round(rot), transweight(style->font_weight.computed), (style->font_style.computed == SP_CSS_FONT_STYLE_ITALIC), style->text_decoration.underline, |
