diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-01-29 13:29:43 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-03-04 22:17:23 +0100 |
commit | 2f8eb233b8de5a7a3a7b997734290b20bf86bd14 (patch) | |
tree | 1fbfdcc2b775df6c19bddc8cf8e0d52bed052cc0 /vcl/inc/widgetdraw | |
parent | 9671ac2dac00c21ae840cb29c2671b22ab95a7b2 (diff) |
remove margin param. and replace it with a relative "rectangle"
Relative rectangle - x1, y1, x2, y2 with valid values in the range
between 0.0 and 1.0, where 0, 0 is top left corner and 1, 1 is the
bottom right corner of the control rectangle.
Change-Id: I2b782a43e91328cf43dc0722e50c55414fb3e867
Reviewed-on: https://gerrit.libreoffice.org/68691
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/inc/widgetdraw')
-rw-r--r-- | vcl/inc/widgetdraw/WidgetDefinition.hxx | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/vcl/inc/widgetdraw/WidgetDefinition.hxx b/vcl/inc/widgetdraw/WidgetDefinition.hxx index 486d61802654..f1035c694cfe 100644 --- a/vcl/inc/widgetdraw/WidgetDefinition.hxx +++ b/vcl/inc/widgetdraw/WidgetDefinition.hxx @@ -37,7 +37,6 @@ public: DrawCommand(DrawCommandType aType) : maType(aType) , mnStrokeWidth(-1) - , mnMargin(0) { } @@ -46,7 +45,6 @@ public: Color maStrokeColor; Color maFillColor; sal_Int32 mnStrokeWidth; - sal_Int32 mnMargin; }; class VCL_DLLPUBLIC RectangleDrawCommand : public DrawCommand @@ -55,10 +53,19 @@ public: sal_Int32 mnRx; sal_Int32 mnRy; + float mfX1; + float mfY1; + float mfX2; + float mfY2; + RectangleDrawCommand() : DrawCommand(DrawCommandType::RECTANGLE) , mnRx(0) , mnRy(0) + , mfX1(0.0f) + , mfY1(0.0f) + , mfX2(1.0f) + , mfY2(1.0f) { } }; @@ -66,8 +73,17 @@ public: class VCL_DLLPUBLIC CircleDrawCommand : public DrawCommand { public: + float mfX1; + float mfY1; + float mfX2; + float mfY2; + CircleDrawCommand() : DrawCommand(DrawCommandType::CIRCLE) + , mfX1(0.0f) + , mfY1(0.0f) + , mfX2(1.0f) + , mfY2(1.0f) { } }; @@ -139,10 +155,11 @@ public: std::vector<std::shared_ptr<DrawCommand>> mpDrawCommands; - void addDrawRectangle(Color aStrokeColor, sal_Int32 nStrokeWidth, Color aFillColor, - sal_Int32 nRx, sal_Int32 nRy, sal_Int32 nMargin); - void addDrawCircle(Color aStrokeColor, sal_Int32 nStrokeWidth, Color aFillColor, - sal_Int32 nMargin); + void addDrawRectangle(Color aStrokeColor, sal_Int32 nStrokeWidth, Color aFillColor, float fX1, + float fY1, float fX2, float fY2, sal_Int32 nRx, sal_Int32 nRy); + void addDrawCircle(Color aStrokeColor, sal_Int32 nStrokeWidth, Color aFillColor, float fX1, + float fY1, float fX2, float fY2); + void addDrawLine(Color aStrokeColor, sal_Int32 nStrokeWidth, float fX1, float fY1, float fX2, float fY2); }; |