diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2010-10-12 17:52:43 +0200 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2010-10-12 17:52:43 +0200 |
commit | b3a56e9917faf102332e03f520458533ef8abdab (patch) | |
tree | 7b61d186cff9b10a6a02de2799499d8de95ab999 | |
parent | bc7459fcc84df81d72786da9dca64a10eaecfe7b (diff) |
vcl116: #i115035# use correct bounding box for action (thanks aw!)
-rw-r--r-- | vcl/source/gdi/print2.cxx | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index d560b0b6e7cc..7e422521cbbb 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -404,9 +404,22 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic break; case META_LINE_ACTION: + { + const MetaLineAction& rMetaLineAction = static_cast<const MetaLineAction&>(rAct); + aActionBounds = Rectangle( rMetaLineAction.GetStartPoint(), rMetaLineAction.GetEndPoint() ); + const long nLineWidth(rMetaLineAction.GetLineInfo().GetWidth()); + if(nLineWidth) + { + const long nHalfLineWidth((nLineWidth + 1) / 2); + aActionBounds.Left() -= nHalfLineWidth; + aActionBounds.Top() -= nHalfLineWidth; + aActionBounds.Right() += nHalfLineWidth; + aActionBounds.Bottom() += nHalfLineWidth; + } aActionBounds = Rectangle( static_cast<const MetaLineAction&>(rAct).GetStartPoint(), static_cast<const MetaLineAction&>(rAct).GetEndPoint() ); break; + } case META_RECT_ACTION: aActionBounds = static_cast<const MetaRectAction&>(rAct).GetRect(); @@ -446,8 +459,20 @@ static Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic break; case META_POLYLINE_ACTION: - aActionBounds = static_cast<const MetaPolyLineAction&>(rAct).GetPolygon().GetBoundRect(); + { + const MetaPolyLineAction& rMetaPolyLineAction = static_cast<const MetaPolyLineAction&>(rAct); + aActionBounds = rMetaPolyLineAction.GetPolygon().GetBoundRect(); + const long nLineWidth(rMetaPolyLineAction.GetLineInfo().GetWidth()); + if(nLineWidth) + { + const long nHalfLineWidth((nLineWidth + 1) / 2); + aActionBounds.Left() -= nHalfLineWidth; + aActionBounds.Top() -= nHalfLineWidth; + aActionBounds.Right() += nHalfLineWidth; + aActionBounds.Bottom() += nHalfLineWidth; + } break; + } case META_POLYGON_ACTION: aActionBounds = static_cast<const MetaPolygonAction&>(rAct).GetPolygon().GetBoundRect(); |