From f4784ce3e582db53e07361f50eafc3762bf03398 Mon Sep 17 00:00:00 2001 From: mathog <> Date: Fri, 17 Feb 2017 09:25:09 -0800 Subject: resolve bug 1665421 (bzr r15525) --- src/extension/internal/wmf-inout.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp index a79af5ec1..42ec2f2bb 100644 --- a/src/extension/internal/wmf-inout.cpp +++ b/src/extension/internal/wmf-inout.cpp @@ -1765,11 +1765,20 @@ std::cout << "BEFORE DRAW" << " test0 " << ( d->mask & U_DRAW_VISIBLE) << " test1 " << ( d->mask & U_DRAW_FORCE) << " test2 " << (wmr_mask & U_DRAW_ALTERS) + << " test2.5 " << ((d->mask & U_DRAW_NOFILL) != (wmr_mask & U_DRAW_NOFILL) ) << " test3 " << (wmr_mask & U_DRAW_VISIBLE) << " test4 " << !(d->mask & U_DRAW_ONLYTO) << " test5 " << ((d->mask & U_DRAW_ONLYTO) && !(wmr_mask & U_DRAW_ONLYTO) ) << std::endl; */ + /* spurious moveto records should not affect the drawing. However, they set the NOFILL + bit and that messes up the logic about when to emit a path. So prune out any + stray moveto records. That is those which were never followed by a lineto. + */ + if((d->mask & U_DRAW_NOFILL) && !(d->mask & U_DRAW_VISIBLE) && + !(wmr_mask & U_DRAW_ONLYTO) && (wmr_mask & U_DRAW_VISIBLE)){ + d->mask ^= U_DRAW_NOFILL; + } if( (wmr_mask != U_WMR_INVALID) && // next record is valid type @@ -1777,6 +1786,7 @@ std::cout << "BEFORE DRAW" ( (d->mask & U_DRAW_FORCE) || // This draw is forced by STROKE/FILL/STROKEANDFILL PATH (wmr_mask & U_DRAW_ALTERS) || // Next record would alter the drawing environment in some way + ((d->mask & U_DRAW_NOFILL) != (wmr_mask & U_DRAW_NOFILL)) || // Fill<->!Fill requires a draw between ( (wmr_mask & U_DRAW_VISIBLE) && // Next record is visible... ( ( !(d->mask & U_DRAW_ONLYTO) ) || // Non *TO records cannot be followed by any Visible -- cgit v1.2.3