Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
cdae5f1e
Kaydet (Commit)
cdae5f1e
authored
Ock 16, 2012
tarafından
Armin Le Grand
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#118784# corrected Svg initial coodinate system usages
üst
9a5fe91a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
9 deletions
+36
-9
svgsvgnode.cxx
svgio/source/svgreader/svgsvgnode.cxx
+36
-9
No files found.
svgio/source/svgreader/svgsvgnode.cxx
Dosyayı görüntüle @
cdae5f1e
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
...
@@ -332,18 +334,37 @@ namespace svgio
...
@@ -332,18 +334,37 @@ namespace svgio
if
(
bDoCorrectCanvasClipping
)
if
(
bDoCorrectCanvasClipping
)
{
{
// different from Svg we have the possibility with primitives to get
// different from Svg we have the possibility with primitives to get
// a correct bounding box for the geometry, thhus I will allow to
// a correct bounding box for the geometry. Get it for evtl. taking action
// only clip if necessary. This will make Svg images evtl. smaller
// than wanted from Svg (the free space which may be around it is
// conform to the Svg spec), but avoids an expensive and unneccessary
// clip.
const
basegfx
::
B2DRange
aContentRange
(
const
basegfx
::
B2DRange
aContentRange
(
drawinglayer
::
primitive2d
::
getB2DRangeFromPrimitive2DSequence
(
drawinglayer
::
primitive2d
::
getB2DRangeFromPrimitive2DSequence
(
aSequence
,
aSequence
,
drawinglayer
::
geometry
::
ViewInformation2D
()));
drawinglayer
::
geometry
::
ViewInformation2D
()));
if
(
!
aSvgCanvasRange
.
isInside
(
aContentRange
))
if
(
aSvgCanvasRange
.
isInside
(
aContentRange
))
{
{
// no clip needed, but an invisible HiddenGeometryPrimitive2D
// to allow getting the full Svg range using the primitive mechanisms.
// This is needed since e.g. an SdrObject using this as graphic will
// create a mapping transformation to exactly map the content to it's
// real life size
const
drawinglayer
::
primitive2d
::
Primitive2DReference
xLine
(
new
drawinglayer
::
primitive2d
::
PolygonHairlinePrimitive2D
(
basegfx
::
tools
::
createPolygonFromRect
(
aSvgCanvasRange
),
basegfx
::
BColor
(
0.0
,
0.0
,
0.0
)));
const
drawinglayer
::
primitive2d
::
Primitive2DReference
xHidden
(
new
drawinglayer
::
primitive2d
::
HiddenGeometryPrimitive2D
(
drawinglayer
::
primitive2d
::
Primitive2DSequence
(
&
xLine
,
1
)));
drawinglayer
::
primitive2d
::
appendPrimitive2DReferenceToPrimitive2DSequence
(
aSequence
,
xHidden
);
}
else
if
(
aSvgCanvasRange
.
overlaps
(
aContentRange
))
{
// Clip is necessary. This will make Svg images evtl. smaller
// than wanted from Svg (the free space which may be around it is
// conform to the Svg spec), but avoids an expensive and unneccessary
// clip. Keep the full Svg range here to get the correct mappings
// to objects using this. Optimizations can be done in the processors
const
drawinglayer
::
primitive2d
::
Primitive2DReference
xMask
(
const
drawinglayer
::
primitive2d
::
Primitive2DReference
xMask
(
new
drawinglayer
::
primitive2d
::
MaskPrimitive2D
(
new
drawinglayer
::
primitive2d
::
MaskPrimitive2D
(
basegfx
::
B2DPolyPolygon
(
basegfx
::
B2DPolyPolygon
(
...
@@ -353,8 +374,14 @@ namespace svgio
...
@@ -353,8 +374,14 @@ namespace svgio
aSequence
=
drawinglayer
::
primitive2d
::
Primitive2DSequence
(
&
xMask
,
1
);
aSequence
=
drawinglayer
::
primitive2d
::
Primitive2DSequence
(
&
xMask
,
1
);
}
}
else
{
// not inside, no overlap. Empty Svg
aSequence
.
realloc
(
0
);
}
}
}
if
(
aSequence
.
hasElements
())
{
{
// embed in transform primitive to scale to 1/100th mm
// embed in transform primitive to scale to 1/100th mm
// where 1 mm == 3.543307 px to get from Svg coordinates to
// where 1 mm == 3.543307 px to get from Svg coordinates to
...
@@ -371,10 +398,10 @@ namespace svgio
...
@@ -371,10 +398,10 @@ namespace svgio
aSequence
));
aSequence
));
aSequence
=
drawinglayer
::
primitive2d
::
Primitive2DSequence
(
&
xTransform
,
1
);
aSequence
=
drawinglayer
::
primitive2d
::
Primitive2DSequence
(
&
xTransform
,
1
);
}
// append
// append to result
drawinglayer
::
primitive2d
::
appendPrimitive2DSequenceToPrimitive2DSequence
(
rTarget
,
aSequence
);
drawinglayer
::
primitive2d
::
appendPrimitive2DSequenceToPrimitive2DSequence
(
rTarget
,
aSequence
);
}
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment