1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <comphelper/diagnose_ex.hxx>
22 #include <canvas/canvastools.hxx>
26 #include <com/sun/star/beans/NamedValue.hpp>
27 #include <com/sun/star/awt/Rectangle.hpp>
28 #include <com/sun/star/animations/ValuePair.hpp>
29 #include <com/sun/star/drawing/FillStyle.hpp>
30 #include <com/sun/star/drawing/LineStyle.hpp>
31 #include <com/sun/star/awt/FontSlant.hpp>
33 #include <basegfx/polygon/b2dpolygon.hxx>
34 #include <basegfx/polygon/b2dpolygontools.hxx>
35 #include <basegfx/range/b2drange.hxx>
36 #include <basegfx/vector/b2dvector.hxx>
37 #include <basegfx/vector/b2ivector.hxx>
38 #include <basegfx/matrix/b2dhommatrix.hxx>
39 #include <basegfx/numeric/ftools.hxx>
40 #include <basegfx/utils/lerp.hxx>
41 #include <basegfx/matrix/b2dhommatrixtools.hxx>
43 #include <cppcanvas/basegfxfactory.hxx>
45 #include <svtools/colorcfg.hxx>
47 #include <unoview.hxx>
48 #include <slideshowexceptions.hxx>
49 #include <smilfunctionparser.hxx>
55 using namespace ::com::sun::star
;
57 namespace slideshow::internal
61 class NamedValueComparator
64 explicit NamedValueComparator( const beans::NamedValue
& rKey
) :
69 bool operator()( const beans::NamedValue
& rValue
) const
71 return rValue
.Name
== mrKey
.Name
&& rValue
.Value
== mrKey
.Value
;
75 const beans::NamedValue
& mrKey
;
78 ::basegfx::B2DHomMatrix
getAttributedShapeTransformation( const ::basegfx::B2DRectangle
& rShapeBounds
,
79 const ShapeAttributeLayerSharedPtr
& pAttr
)
81 ::basegfx::B2DHomMatrix aTransform
;
82 const basegfx::B2DSize
rSize(rShapeBounds
.getRange().getX(), rShapeBounds
.getRange().getY());
84 const double nShearX( pAttr
->isShearXAngleValid() ?
85 pAttr
->getShearXAngle() :
87 const double nShearY( pAttr
->isShearYAngleValid() ?
88 pAttr
->getShearYAngle() :
90 const double nRotation( pAttr
->isRotationAngleValid() ?
91 basegfx::deg2rad(pAttr
->getRotationAngle()) :
94 // scale, shear and rotation pivot point is the shape
95 // center - adapt origin accordingly
96 aTransform
.translate( -0.5, -0.5 );
98 // ensure valid size (zero size will inevitably lead
99 // to a singular transformation matrix)
100 aTransform
.scale( ::basegfx::pruneScaleValue(
102 ::basegfx::pruneScaleValue(
103 rSize
.getHeight() ) );
105 const bool bNeedShearX( !::basegfx::fTools::equalZero(nShearX
) );
106 const bool bNeedShearY( !::basegfx::fTools::equalZero(nShearY
) );
107 const bool bNeedRotation( !::basegfx::fTools::equalZero(nRotation
) );
109 if( bNeedRotation
|| bNeedShearX
|| bNeedShearY
)
112 aTransform
.shearX( nShearX
);
115 aTransform
.shearY( nShearY
);
118 aTransform
.rotate( nRotation
);
121 // move left, top corner back to position of the
122 // shape. Since we've already translated the
123 // center of the shape to the origin (the
124 // translate( -0.5, -0.5 ) above), translate to
125 // center of final shape position here.
126 aTransform
.translate( rShapeBounds
.getCenterX(),
127 rShapeBounds
.getCenterY() );
133 // Value extraction from Any
134 // =========================
136 /// extract unary double value from Any
137 bool extractValue( double& o_rValue
,
138 const uno::Any
& rSourceAny
,
139 const ShapeSharedPtr
& rShape
,
140 const ::basegfx::B2DVector
& rSlideBounds
)
142 // try to extract numeric value (double, or smaller POD, like float or int)
143 if( rSourceAny
>>= o_rValue
)
149 // try to extract string
151 if( !(rSourceAny
>>= aString
) )
152 return false; // nothing left to try
154 // parse the string into an ExpressionNode
157 // Parse string into ExpressionNode, eval node at time 0.0
158 o_rValue
= (*SmilFunctionParser::parseSmilValue(
160 calcRelativeShapeBounds(rSlideBounds
,
161 rShape
->getBounds()) ))(0.0);
171 /// extract enum/constant group value from Any
172 bool extractValue( sal_Int32
& o_rValue
,
173 const uno::Any
& rSourceAny
,
174 const ShapeSharedPtr
& /*rShape*/,
175 const ::basegfx::B2DVector
& /*rSlideBounds*/ )
177 // try to extract numeric value (int, or smaller POD, like byte)
178 if( rSourceAny
>>= o_rValue
)
184 // okay, no plain int. Maybe one of the domain-specific enums?
185 drawing::FillStyle eFillStyle
;
186 if( rSourceAny
>>= eFillStyle
)
188 o_rValue
= sal::static_int_cast
<sal_Int16
>(eFillStyle
);
194 drawing::LineStyle eLineStyle
;
195 if( rSourceAny
>>= eLineStyle
)
197 o_rValue
= sal::static_int_cast
<sal_Int16
>(eLineStyle
);
203 awt::FontSlant eFontSlant
;
204 if( rSourceAny
>>= eFontSlant
)
206 o_rValue
= sal::static_int_cast
<sal_Int16
>(eFontSlant
);
212 // nothing left to try. Failure
216 /// extract enum/constant group value from Any
217 bool extractValue( sal_Int16
& o_rValue
,
218 const uno::Any
& rSourceAny
,
219 const ShapeSharedPtr
& rShape
,
220 const ::basegfx::B2DVector
& rSlideBounds
)
223 if( !extractValue(aValue
,rSourceAny
,rShape
,rSlideBounds
) )
226 if( std::numeric_limits
<sal_Int16
>::max() < aValue
||
227 std::numeric_limits
<sal_Int16
>::min() > aValue
)
232 o_rValue
= static_cast<sal_Int16
>(aValue
);
237 /// extract color value from Any
238 bool extractValue( RGBColor
& o_rValue
,
239 const uno::Any
& rSourceAny
,
240 const ShapeSharedPtr
& /*rShape*/,
241 const ::basegfx::B2DVector
& /*rSlideBounds*/ )
243 // try to extract numeric value (double, or smaller POD, like float or int)
246 if( rSourceAny
>>= nTmp
)
248 sal_uInt32
aIntColor( static_cast< sal_uInt32
>(nTmp
) );
250 // TODO(F2): Handle color values correctly, here
251 o_rValue
= unoColor2RGBColor( aIntColor
);
258 // try double sequence
260 uno::Sequence
< double > aTmp
;
261 if( rSourceAny
>>= aTmp
)
263 ENSURE_OR_THROW( aTmp
.getLength() == 3,
264 "extractValue(): inappropriate length for RGB color value" );
266 o_rValue
= RGBColor( aTmp
[0], aTmp
[1], aTmp
[2] );
273 // try sal_Int32 sequence
275 uno::Sequence
< sal_Int32
> aTmp
;
276 if( rSourceAny
>>= aTmp
)
278 ENSURE_OR_THROW( aTmp
.getLength() == 3,
279 "extractValue(): inappropriate length for RGB color value" );
282 o_rValue
= RGBColor( ::cppcanvas::makeColor(
283 static_cast<sal_uInt8
>(aTmp
[0]),
284 static_cast<sal_uInt8
>(aTmp
[1]),
285 static_cast<sal_uInt8
>(aTmp
[2]),
293 // try sal_Int8 sequence
295 uno::Sequence
< sal_Int8
> aTmp
;
296 if( rSourceAny
>>= aTmp
)
298 ENSURE_OR_THROW( aTmp
.getLength() == 3,
299 "extractValue(): inappropriate length for RGB color value" );
301 o_rValue
= RGBColor( ::cppcanvas::makeColor( aTmp
[0], aTmp
[1], aTmp
[2], 255 ) );
308 // try to extract string
310 if( !(rSourceAny
>>= aString
) )
311 return false; // nothing left to try
313 // TODO(F2): Provide symbolic color values here
314 o_rValue
= RGBColor( 0.5, 0.5, 0.5 );
319 /// extract color value from Any
320 bool extractValue( HSLColor
& o_rValue
,
321 const uno::Any
& rSourceAny
,
322 const ShapeSharedPtr
& /*rShape*/,
323 const ::basegfx::B2DVector
& /*rSlideBounds*/ )
325 // try double sequence
327 uno::Sequence
< double > aTmp
;
328 if( rSourceAny
>>= aTmp
)
330 ENSURE_OR_THROW( aTmp
.getLength() == 3,
331 "extractValue(): inappropriate length for HSL color value" );
333 o_rValue
= HSLColor( aTmp
[0], aTmp
[1], aTmp
[2] );
340 // try sal_Int8 sequence
342 uno::Sequence
< sal_Int8
> aTmp
;
343 if( rSourceAny
>>= aTmp
)
345 ENSURE_OR_THROW( aTmp
.getLength() == 3,
346 "extractValue(): inappropriate length for HSL color value" );
348 o_rValue
= HSLColor( aTmp
[0]*360.0/255.0, aTmp
[1]/255.0, aTmp
[2]/255.0 );
355 return false; // nothing left to try
358 /// extract plain string from Any
359 bool extractValue( OUString
& o_rValue
,
360 const uno::Any
& rSourceAny
,
361 const ShapeSharedPtr
& /*rShape*/,
362 const ::basegfx::B2DVector
& /*rSlideBounds*/ )
364 // try to extract string
365 return rSourceAny
>>= o_rValue
;
368 /// extract bool value from Any
369 bool extractValue( bool& o_rValue
,
370 const uno::Any
& rSourceAny
,
371 const ShapeSharedPtr
& /*rShape*/,
372 const ::basegfx::B2DVector
& /*rSlideBounds*/ )
375 // try to extract bool value
376 if( rSourceAny
>>= bTmp
)
384 // try to extract string
386 if( !(rSourceAny
>>= aString
) )
387 return false; // nothing left to try
389 // we also take the strings "true" and "false",
390 // as well as "on" and "off" here
391 if( aString
.equalsIgnoreAsciiCase("true") ||
392 aString
.equalsIgnoreAsciiCase("on") )
397 if( aString
.equalsIgnoreAsciiCase("false") ||
398 aString
.equalsIgnoreAsciiCase("off") )
404 // ultimately failed.
408 /// extract double 2-tuple from Any
409 bool extractValue( ::basegfx::B2DTuple
& o_rPair
,
410 const uno::Any
& rSourceAny
,
411 const ShapeSharedPtr
& rShape
,
412 const ::basegfx::B2DVector
& rSlideBounds
)
414 animations::ValuePair aPair
;
416 if( !(rSourceAny
>>= aPair
) )
420 if( !extractValue( nFirst
, aPair
.First
, rShape
, rSlideBounds
) )
424 if( !extractValue( nSecond
, aPair
.Second
, rShape
, rSlideBounds
) )
427 o_rPair
.setX( nFirst
);
428 o_rPair
.setY( nSecond
);
433 bool findNamedValue( uno::Sequence
< beans::NamedValue
> const& rSequence
,
434 const beans::NamedValue
& rSearchKey
)
436 return ::std::any_of( rSequence
.begin(), rSequence
.end(),
437 NamedValueComparator( rSearchKey
) );
440 basegfx::B2DRange
calcRelativeShapeBounds( const basegfx::B2DVector
& rPageSize
,
441 const basegfx::B2DRange
& rShapeBounds
)
443 return basegfx::B2DRange( rShapeBounds
.getMinX() / rPageSize
.getX(),
444 rShapeBounds
.getMinY() / rPageSize
.getY(),
445 rShapeBounds
.getMaxX() / rPageSize
.getX(),
446 rShapeBounds
.getMaxY() / rPageSize
.getY() );
449 // TODO(F2): Currently, the positional attributes DO NOT mirror the XShape properties.
450 // First and foremost, this is because we must operate with the shape boundrect,
451 // not position and size (the conversion between logic rect, snap rect and boundrect
452 // are non-trivial for draw shapes, and I won't duplicate them here). Thus, shapes
453 // rotated on the page will still have 0.0 rotation angle, as the metafile
454 // representation fetched over the API is our default zero case.
456 ::basegfx::B2DHomMatrix
getShapeTransformation( const ::basegfx::B2DRectangle
& rShapeBounds
,
457 const ShapeAttributeLayerSharedPtr
& pAttr
)
461 const basegfx::B2DHomMatrix
aTransform(basegfx::utils::createScaleTranslateB2DHomMatrix(
462 rShapeBounds
.getWidth(), rShapeBounds
.getHeight(),
463 rShapeBounds
.getMinX(), rShapeBounds
.getMinY()));
469 return getAttributedShapeTransformation( rShapeBounds
,
474 ::basegfx::B2DHomMatrix
getSpriteTransformation( const ::basegfx::B2DVector
& rPixelSize
,
475 const ::basegfx::B2DVector
& rOrigSize
,
476 const ShapeAttributeLayerSharedPtr
& pAttr
)
478 ::basegfx::B2DHomMatrix aTransform
;
482 const double nShearX( pAttr
->isShearXAngleValid() ?
483 pAttr
->getShearXAngle() :
485 const double nShearY( pAttr
->isShearYAngleValid() ?
486 pAttr
->getShearYAngle() :
488 const double nRotation( pAttr
->isRotationAngleValid() ?
489 basegfx::deg2rad(pAttr
->getRotationAngle()) :
492 // scale, shear and rotation pivot point is the
493 // sprite's pixel center - adapt origin accordingly
494 aTransform
.translate( -0.5*rPixelSize
.getX(),
495 -0.5*rPixelSize
.getY() );
497 const ::basegfx::B2DSize
aSize(
498 pAttr
->isWidthValid() ? pAttr
->getWidth() : rOrigSize
.getX(),
499 pAttr
->isHeightValid() ? pAttr
->getHeight() : rOrigSize
.getY() );
501 // ensure valid size (zero size will inevitably lead
502 // to a singular transformation matrix).
503 aTransform
.scale( ::basegfx::pruneScaleValue(
505 ::basegfx::pruneScaleValue(
506 rOrigSize
.getX() ) ),
507 ::basegfx::pruneScaleValue(
509 ::basegfx::pruneScaleValue(
510 rOrigSize
.getY() ) ) );
512 const bool bNeedShearX( !::basegfx::fTools::equalZero(nShearX
) );
513 const bool bNeedShearY( !::basegfx::fTools::equalZero(nShearY
) );
514 const bool bNeedRotation( !::basegfx::fTools::equalZero(nRotation
) );
516 if( bNeedRotation
|| bNeedShearX
|| bNeedShearY
)
519 aTransform
.shearX( nShearX
);
522 aTransform
.shearY( nShearY
);
525 aTransform
.rotate( nRotation
);
528 // move left, top corner back to original position of
529 // the sprite (we've translated the center of the
530 // sprite to the origin above).
531 aTransform
.translate( 0.5*rPixelSize
.getX(),
532 0.5*rPixelSize
.getY() );
535 // return identity transform for un-attributed
536 // shapes. This renders the sprite as-is, in its
537 // document-supplied size.
541 ::basegfx::B2DRectangle
getShapeUpdateArea( const ::basegfx::B2DRectangle
& rUnitBounds
,
542 const ::basegfx::B2DHomMatrix
& rShapeTransform
,
543 const ShapeAttributeLayerSharedPtr
& pAttr
)
545 ::basegfx::B2DHomMatrix aTransform
;
548 pAttr
->isCharScaleValid() &&
549 fabs(pAttr
->getCharScale()) > 1.0 )
551 // enlarge shape bounds. Have to consider the worst
552 // case here (the text fully fills the shape)
554 const double nCharScale( pAttr
->getCharScale() );
556 // center of scaling is the middle of the shape
557 aTransform
.translate( -0.5, -0.5 );
558 aTransform
.scale( nCharScale
, nCharScale
);
559 aTransform
.translate( 0.5, 0.5 );
562 aTransform
*= rShapeTransform
;
564 ::basegfx::B2DRectangle aRes
;
566 // apply shape transformation to unit rect
567 return ::canvas::tools::calcTransformedRectBounds(
573 ::basegfx::B2DRange
getShapeUpdateArea( const ::basegfx::B2DRange
& rUnitBounds
,
574 const ::basegfx::B2DRange
& rShapeBounds
)
576 return ::basegfx::B2DRectangle(
577 basegfx::utils::lerp( rShapeBounds
.getMinX(),
578 rShapeBounds
.getMaxX(),
579 rUnitBounds
.getMinX() ),
580 basegfx::utils::lerp( rShapeBounds
.getMinY(),
581 rShapeBounds
.getMaxY(),
582 rUnitBounds
.getMinY() ),
583 basegfx::utils::lerp( rShapeBounds
.getMinX(),
584 rShapeBounds
.getMaxX(),
585 rUnitBounds
.getMaxX() ),
586 basegfx::utils::lerp( rShapeBounds
.getMinY(),
587 rShapeBounds
.getMaxY(),
588 rUnitBounds
.getMaxY() ) );
591 ::basegfx::B2DRectangle
getShapePosSize( const ::basegfx::B2DRectangle
& rOrigBounds
,
592 const ShapeAttributeLayerSharedPtr
& pAttr
)
594 // an already empty shape bound need no further
595 // treatment. In fact, any changes applied below would
596 // actually remove the special empty state, thus, don't
599 rOrigBounds
.isEmpty() )
605 // cannot use maBounds anymore, attributes might have been
607 // Have to use absolute values here, as negative sizes
608 // (aka mirrored shapes) _still_ have the same bounds,
609 // only with mirrored content.
610 ::basegfx::B2DSize aSize
;
611 aSize
.setWidth( fabs( pAttr
->isWidthValid() ?
613 rOrigBounds
.getWidth() ) );
614 aSize
.setHeight( fabs( pAttr
->isHeightValid() ?
616 rOrigBounds
.getHeight() ) );
618 ::basegfx::B2DPoint aPos
;
619 aPos
.setX( pAttr
->isPosXValid() ?
621 rOrigBounds
.getCenterX() );
622 aPos
.setY( pAttr
->isPosYValid() ?
624 rOrigBounds
.getCenterY() );
626 // the positional attribute retrieved from the
627 // ShapeAttributeLayer actually denotes the _middle_
628 // of the shape (do it as the PPTs do...)
629 return ::basegfx::B2DRectangle(aPos
- 0.5 * basegfx::B2DPoint(aSize
),
630 aPos
+ 0.5 * basegfx::B2DPoint(aSize
));
634 RGBColor
unoColor2RGBColor( sal_Int32 nColor
)
637 ::cppcanvas::makeColor(
638 // convert from API color to IntSRGBA color
639 // (0xAARRGGBB -> 0xRRGGBBAA)
640 static_cast< sal_uInt8
>( nColor
>> 16U ),
641 static_cast< sal_uInt8
>( nColor
>> 8U ),
642 static_cast< sal_uInt8
>( nColor
),
643 static_cast< sal_uInt8
>( nColor
>> 24U ) ) );
646 sal_Int32
RGBAColor2UnoColor( ::cppcanvas::IntSRGBA aColor
)
648 return ::cppcanvas::makeColorARGB(
649 // convert from IntSRGBA color to API color
650 // (0xRRGGBBAA -> 0xAARRGGBB)
651 static_cast< sal_uInt8
>(0),
652 ::cppcanvas::getRed(aColor
),
653 ::cppcanvas::getGreen(aColor
),
654 ::cppcanvas::getBlue(aColor
));
657 void fillRect( const ::cppcanvas::CanvasSharedPtr
& rCanvas
,
658 const ::basegfx::B2DRectangle
& rRect
,
659 ::cppcanvas::IntSRGBA aFillColor
)
661 const ::basegfx::B2DPolygon
aPoly(
662 ::basegfx::utils::createPolygonFromRect( rRect
));
664 ::cppcanvas::PolyPolygonSharedPtr
pPolyPoly(
665 ::cppcanvas::BaseGfxFactory::createPolyPolygon( rCanvas
, aPoly
) );
669 pPolyPoly
->setRGBAFillColor( aFillColor
);
674 void initSlideBackground( const ::cppcanvas::CanvasSharedPtr
& rCanvas
,
675 const ::basegfx::B2ISize
& rSize
)
677 ::cppcanvas::CanvasSharedPtr
pCanvas( rCanvas
->clone() );
679 // set transformation to identity (->device pixel)
680 pCanvas
->setTransformation( ::basegfx::B2DHomMatrix() );
682 // #i42440# Fill the _full_ background in
683 // black. Since we had to extend the bitmap by one
684 // pixel, and the bitmap is initialized white,
685 // depending on the slide content a one pixel wide
686 // line will show to the bottom and the right.
688 ::basegfx::B2DRectangle( 0.0, 0.0,
693 // tdf#148884 in dark mode impress's auto text color assumes it will render against
694 // the DOCCOLOR by default, so leaving this as white gives white on white, this
695 // looks the simplest approach, propagate dark mode into slideshow mode instead
696 // of reformatting to render onto a white slideshow
697 svtools::ColorConfig aColorConfig
;
698 Color aApplicationDocumentColor
= aColorConfig
.GetColorValue(svtools::DOCCOLOR
).nColor
;
699 cppcanvas::IntSRGBA nCanvasColor
= cppcanvas::makeColor(aApplicationDocumentColor
.GetRed(),
700 aApplicationDocumentColor
.GetGreen(),
701 aApplicationDocumentColor
.GetBlue(),
704 // fill the bounds rectangle in DOCCOLOR (typically white).
705 // Subtract one pixel from both width and height, because the slide
706 // size is chosen one pixel larger than given by the drawing layer.
707 // This is because shapes with line style, that have the size of
708 // the slide would otherwise be cut off. OTOH, every other slide
709 // background (solid fill, gradient, bitmap) render one pixel less,
710 // thus revealing ugly white pixel to the right and the bottom.
712 ::basegfx::B2DRectangle( 0.0, 0.0,
718 ::basegfx::B2DRectangle
getAPIShapeBounds( const uno::Reference
< drawing::XShape
>& xShape
)
720 uno::Reference
< beans::XPropertySet
> xPropSet( xShape
,
721 uno::UNO_QUERY_THROW
);
723 awt::Rectangle aTmpRect
;
724 if( !(xPropSet
->getPropertyValue("BoundRect") >>= aTmpRect
) )
726 ENSURE_OR_THROW( false,
727 "getAPIShapeBounds(): Could not get \"BoundRect\" property from shape" );
730 return ::basegfx::B2DRectangle( aTmpRect
.X
,
732 aTmpRect
.X
+aTmpRect
.Width
,
733 aTmpRect
.Y
+aTmpRect
.Height
);
737 TODO(F1): When ZOrder someday becomes usable enable this
739 double getAPIShapePrio( const uno::Reference< drawing::XShape >& xShape )
741 uno::Reference< beans::XPropertySet > xPropSet( xShape,
742 uno::UNO_QUERY_THROW );
745 if( !(xPropSet->getPropertyValue(
746 OUString("ZOrder") ) >>= nPrio) )
748 ENSURE_OR_THROW( false,
749 "getAPIShapePrio(): Could not get \"ZOrder\" property from shape" );
752 // TODO(F2): Check and adapt the range of possible values here.
753 // Maybe we can also take the total number of shapes here
754 return nPrio / 65535.0;
758 basegfx::B2IVector
getSlideSizePixel( const basegfx::B2DVector
& rSlideSize
,
759 const UnoViewSharedPtr
& pView
)
761 ENSURE_OR_THROW(pView
, "getSlideSizePixel(): invalid view");
763 // determine transformed page bounds
764 const basegfx::B2DRange
aRect( 0,0,
767 basegfx::B2DRange aTmpRect
;
768 canvas::tools::calcTransformedRectBounds( aTmpRect
,
770 pView
->getTransformation() );
772 // #i42440# Returned slide size is one pixel too small, as
773 // rendering happens one pixel to the right and below the
774 // actual bound rect.
775 return basegfx::B2IVector(
776 basegfx::fround( aTmpRect
.getRange().getX() ) + 1,
777 basegfx::fround( aTmpRect
.getRange().getY() ) + 1 );
781 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */