@@ -87,18 +87,6 @@ namespace
8787
8888 return nSteps;
8989 }
90-
91- // get metafile (copy it)
92- GDIMetaFile GetMetaFile (const drawinglayer::primitive2d::MetafilePrimitive2D& rMetaCandidate, const basegfx::BColorModifierStack& rColorModifierStack)
93- {
94- if (rColorModifierStack.count ())
95- {
96- const basegfx::BColor aRGBBaseColor (0 , 0 , 0 );
97- const basegfx::BColor aRGBColor (rColorModifierStack.getModifiedColor (aRGBBaseColor));
98- return rMetaCandidate.getMetaFile ().GetMonochromeMtf (Color (aRGBColor));
99- }
100- return rMetaCandidate.getMetaFile ();
101- }
10290}
10391
10492namespace drawinglayer
@@ -713,86 +701,6 @@ namespace drawinglayer
713701 }
714702 }
715703
716- // direct draw of MetaFile
717- void VclProcessor2D::RenderMetafilePrimitive2D (const primitive2d::MetafilePrimitive2D& rMetaCandidate)
718- {
719- // decompose matrix to check for shear, rotate and mirroring
720- basegfx::B2DHomMatrix aLocalTransform (maCurrentTransformation * rMetaCandidate.getTransform ());
721- basegfx::B2DVector aScale, aTranslate;
722- double fRotate , fShearX ;
723- aLocalTransform.decompose (aScale, aTranslate, fRotate , fShearX );
724-
725- if (basegfx::fTools::less (aScale.getX (), 0.0 ) && basegfx::fTools::less (aScale.getY (), 0.0 ))
726- {
727- // #i102175# handle special case: If scale is negative in (x,y) (3rd quadrant), it can
728- // be expressed as rotation by PI. This needs to be done for Metafiles since
729- // these can be rotated, but not really mirrored
730- aScale = basegfx::absolute (aScale);
731- fRotate += F_PI;
732- }
733-
734- // get BoundRect
735- basegfx::B2DRange aOutlineRange (rMetaCandidate.getB2DRange (getViewInformation2D ()));
736- aOutlineRange.transform (maCurrentTransformation);
737-
738- // Due to the integer MapModes used from VCL aind inside MetaFiles errors of up to three
739- // pixels in size may happen. As long as there is no better way (e.g. convert the MetaFile
740- // to primitives) it is necessary to reduce maximum pixel size by 1 in X and Y and to use
741- // the inner pixel bounds accordingly (ceil resp. floor). This will also be done for logic
742- // units e.g. when creating a new MetaFile, but since much huger value ranges are used
743- // there typically will be okay for this compromise.
744- tools::Rectangle aDestRectView (
745- // !!CAUTION!! Here, ceil and floor are exchanged BY PURPOSE, do NOT copy when
746- // looking for a standard conversion to rectangle (!)
747- (sal_Int32)ceil (aOutlineRange.getMinX ()), (sal_Int32)ceil (aOutlineRange.getMinY ()),
748- (sal_Int32)floor (aOutlineRange.getMaxX ()), (sal_Int32)floor (aOutlineRange.getMaxY ()));
749-
750- // get metafile (copy it)
751- GDIMetaFile aMetaFile (GetMetaFile (rMetaCandidate, maBColorModifierStack));
752-
753- // rotation
754- if (!basegfx::fTools::equalZero (fRotate ))
755- {
756- // #i103530#
757- // MetaFile::Rotate has no input parameter check, so the parameter needs to be
758- // well-aligned to the old range [0..3600] 10th degrees with inverse orientation
759- sal_Int16 nRotation ((sal_Int16)((fRotate / F_PI180) * -10.0 ));
760-
761- while (nRotation < 0 )
762- nRotation += 3600 ;
763-
764- while (nRotation >= 3600 )
765- nRotation -= 3600 ;
766-
767- aMetaFile.Rotate (nRotation);
768- }
769-
770- // Prepare target output size
771- Size aDestSize (aDestRectView.GetSize ());
772-
773- if (aDestSize.getWidth () > 0 && aDestSize.getHeight () > 0 )
774- {
775- // Get preferred Metafile output size. When it's very equal to the output size, it's probably
776- // a rounding error somewhere, so correct it to get a 1:1 output without single pixel scalings
777- // of the Metafile (esp. for contained Bitmaps, e.g 3D charts)
778- const Size aPrefSize (mpOutputDevice->LogicToPixel (aMetaFile.GetPrefSize (), aMetaFile.GetPrefMapMode ()));
779-
780- if (aPrefSize.getWidth () && (aPrefSize.getWidth () - 1 == aDestSize.getWidth () || aPrefSize.getWidth () + 1 == aDestSize.getWidth ()))
781- {
782- aDestSize.setWidth (aPrefSize.getWidth ());
783- }
784-
785- if (aPrefSize.getHeight () && (aPrefSize.getHeight () - 1 == aDestSize.getHeight () || aPrefSize.getHeight () + 1 == aDestSize.getHeight ()))
786- {
787- aDestSize.setHeight (aPrefSize.getHeight ());
788- }
789-
790- // paint it
791- aMetaFile.WindStart ();
792- aMetaFile.Play (mpOutputDevice, aDestRectView.TopLeft (), aDestSize);
793- }
794- }
795-
796704 // mask group. Force output to VDev and create mask from given mask
797705 void VclProcessor2D::RenderMaskPrimitive2DPixel (const primitive2d::MaskPrimitive2D& rMaskCandidate)
798706 {
0 commit comments