Kaydet (Commit) 30f8d566 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

improve diagram rendering

Size and positioning look much better right now.

Change-Id: I3422087967af1231e9e9fbaf87f1c7c2db25958a
üst 6f50837b
...@@ -417,6 +417,11 @@ class DummyGroup2D : public DummyXShapes ...@@ -417,6 +417,11 @@ class DummyGroup2D : public DummyXShapes
{ {
public: public:
DummyGroup2D(const OUString& rName); DummyGroup2D(const OUString& rName);
virtual ::com::sun::star::awt::Point SAL_CALL getPosition() throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::awt::Size SAL_CALL getSize() throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) throw(::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException);
}; };
class DummyGroup3D : public DummyXShapes class DummyGroup3D : public DummyXShapes
......
...@@ -805,6 +805,58 @@ DummyGroup2D::DummyGroup2D(const OUString& rName) ...@@ -805,6 +805,58 @@ DummyGroup2D::DummyGroup2D(const OUString& rName)
setName(rName); setName(rName);
} }
awt::Point DummyGroup2D::getPosition()
throw(uno::RuntimeException)
{
long nTop = std::numeric_limits<long>::max();
long nLeft = std::numeric_limits<long>::max();
for(std::vector<DummyXShape*>::iterator itr = maShapes.begin(),
itrEnd = maShapes.end(); itr != itrEnd; ++itr)
{
awt::Point aPoint = (*itr)->getPosition();
if(aPoint.X >= 0 && aPoint.Y >= 0)
{
nLeft = std::min<long>(nLeft, aPoint.X);
nTop = std::min<long>(nTop, aPoint.Y);
}
}
return awt::Point(nTop, nLeft);
}
awt::Size DummyGroup2D::getSize()
throw(uno::RuntimeException)
{
long nTop = std::numeric_limits<long>::max();
long nLeft = std::numeric_limits<long>::max();
long nBottom = 0;
long nRight = 0;
for(std::vector<DummyXShape*>::iterator itr = maShapes.begin(),
itrEnd = maShapes.end(); itr != itrEnd; ++itr)
{
awt::Point aPoint = (*itr)->getPosition();
nLeft = std::min<long>(nLeft, aPoint.X);
nTop = std::min<long>(nTop, aPoint.Y);
awt::Size aSize = (*itr)->getSize();
nRight = std::max<long>(nRight, aPoint.X + aSize.Width);
nBottom = std::max<long>(nBottom, aPoint.Y + aSize.Height);
}
return awt::Size(nRight - nLeft, nBottom - nTop);
}
void DummyGroup2D::setPosition( const awt::Point& )
throw(uno::RuntimeException)
{
SAL_WARN("chart2.opengl", "set position on group shape");
}
void DummyGroup2D::setSize( const awt::Size& )
throw( beans::PropertyVetoException, uno::RuntimeException )
{
SAL_WARN("chart2.opengl", "set size on group shape");
}
DummyGraphic2D::DummyGraphic2D(const drawing::Position3D& rPos, const drawing::Direction3D& rSize, DummyGraphic2D::DummyGraphic2D(const drawing::Position3D& rPos, const drawing::Direction3D& rSize,
const uno::Reference< graphic::XGraphic > xGraphic ): const uno::Reference< graphic::XGraphic > xGraphic ):
mxGraphic(xGraphic) mxGraphic(xGraphic)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment