From bf85e8c94daf3073128168d131edb930ce05eace Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Tue, 29 Jan 2019 13:29:43 +0100 Subject: remove margin param. and replace it with a relative "rectangle" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 2f8eb233b8de5a7a3a7b997734290b20bf86bd14) --- vcl/inc/widgetdraw/WidgetDefinition.hxx | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'vcl/inc') 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> 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); }; -- cgit