summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2023-03-14 15:32:29 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2023-03-23 07:01:00 +0000
commit584c9914fc4da76839ecdb3efed36381bee21954 (patch)
treee59448711ef9a06e1df52f2fbd73b8e1bb97986a /vcl
parent6dfa9c7c0db91a71f3787226636864161d5367ca (diff)
jsdialog: render full edit engine content
Change-Id: I43c2deb75619956b95cdc1d2693a7540d5c8f894 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148888 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149326 Tested-by: Jenkins
Diffstat (limited to 'vcl')
-rw-r--r--vcl/jsdialog/executor.cxx2
-rw-r--r--vcl/source/window/layout.cxx13
2 files changed, 11 insertions, 4 deletions
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 4668193cb579..94f2ad058bde 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -206,7 +206,7 @@ bool ExecuteAction(const std::string& nWindowId, const OString& rWidget, StringM
// We send OutPutSize for the drawing area bitmap
// get_size_request is not necessarily updated
// therefore it may be incorrect.
- Size size = rRefDevice.GetOutputSize();
+ Size size = rRefDevice.GetOutputSizePixel();
posX = posX * size.Width();
posY = posY * size.Height();
if (sAction == "click")
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 6befd3399520..f119b050d567 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -3089,10 +3089,17 @@ void VclDrawingArea::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
rJsonWriter.put("type", "drawingarea");
ScopedVclPtrInstance<VirtualDevice> pDevice;
- pDevice->SetOutputSize( GetSizePixel() );
- tools::Rectangle aRect(Point(0,0), GetSizePixel());
+ OutputDevice* pRefDevice = GetOutDev();
+ Size aRenderSize(pRefDevice->PixelToLogic(GetOutputSizePixel()));
+ Size aOutputSize = GetSizePixel();
+ pDevice->SetOutputSize(aRenderSize);
+ tools::Rectangle aRect(Point(0,0), aRenderSize);
+
Paint(*pDevice, aRect);
- BitmapEx aImage = pDevice->GetBitmapEx( Point(0,0), GetSizePixel() );
+
+ BitmapEx aImage = pDevice->GetBitmapEx(Point(0,0), aRenderSize);
+ aImage.Scale(aOutputSize);
+
SvMemoryStream aOStm(65535, 65535);
if(GraphicConverter::Export(aOStm, aImage, ConvertDataFormat::PNG) == ERRCODE_NONE)
{