vcl/jsdialog/executor.cxx    |    2 +-
 vcl/source/window/layout.cxx |   13 ++++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 1ec36485afab326eb0ac0e2c96a0ed5320fb255c
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Tue Mar 14 15:32:29 2023 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Wed Mar 15 10:01:32 2023 +0000

    jsdialog: render full edit engine content
    
    Change-Id: I43c2deb75619956b95cdc1d2693a7540d5c8f894
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148888
    Tested-by: Szymon Kłos <szymon.k...@collabora.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>

diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 6532f562e1ec..33e5884c74d2 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 73773192397f..787c794d0ff4 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -3056,10 +3056,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)
     {

Reply via email to