diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-08-15 11:57:57 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-08-28 14:00:17 +0200 |
commit | 0d68ff1c2eb2fdd85909fd440f9182b1340300b7 (patch) | |
tree | ecc7c5d97d267b69379f72986c3dfb6f2bcaa52c /starmath | |
parent | b1996ece575196052ee09833c8a887238c3e2972 (diff) |
Resolves: tdf#149858 embedded starmath not using correct initial zoom
since...
commit ea21b870f8549d0110ef65187af50694a06458ca
Date: Mon Apr 19 15:22:22 2021 +0100
weld SmGraphicWindow
where the outer Window is not directly drawn into any more
Change-Id: I70f45590f0fb7ff2f7af80da8873d580d219aca4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138280
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/view.hxx | 6 | ||||
-rw-r--r-- | starmath/source/view.cxx | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index 4ab877358f94..3094eaf6ebbd 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -54,9 +54,6 @@ private: DECL_LINK(ScrollHdl, weld::ScrolledWindow&, void); - void SetGraphicMapMode(const MapMode& rNewMapMode); - MapMode GetGraphicMapMode() const; - public: explicit SmGraphicWindow(SmViewShell& rShell); virtual void dispose() override; @@ -75,6 +72,9 @@ public: virtual void Resize() override; void ShowContextMenu(const CommandEvent& rCEvt); + void SetGraphicMapMode(const MapMode& rNewMapMode); + MapMode GetGraphicMapMode() const; + SmGraphicWidget& GetGraphicWidget() { return *mxGraphic; diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index f2d5859a0da1..7ebd822c7ed3 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -1101,8 +1101,12 @@ void SmViewShell::InnerResizePixel(const Point &rOfs, const Size &rSize, bool) if ( !aObjSize.IsEmpty() ) { Size aProvidedSize = GetWindow()->PixelToLogic(rSize, MapMode(MapUnit::Map100thMM)); - SfxViewShell::SetZoomFactor( Fraction( aProvidedSize.Width(), aObjSize.Width() ), - Fraction( aProvidedSize.Height(), aObjSize.Height() ) ); + Fraction aZoomX(aProvidedSize.Width(), aObjSize.Width()); + Fraction aZoomY(aProvidedSize.Height(), aObjSize.Height()); + MapMode aMap(mxGraphicWindow->GetGraphicMapMode()); + aMap.SetScaleX(aZoomX); + aMap.SetScaleY(aZoomY); + mxGraphicWindow->SetGraphicMapMode(aMap); } SetBorderPixel( SvBorder() ); |