diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-18 17:17:09 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-18 20:43:15 +0000 |
commit | db9ef688edd86b31606e0dd6df6a77732faca49b (patch) | |
tree | 30efa88441bbbeebd84e538d1e809ebd141cab44 /include/vcl/ctrl.hxx | |
parent | b93856a666cc0af099c934669a3d593116456b84 (diff) |
Resolves: tdf#98593 buttons in writer show different text at different zooms
The DrawControlText always renders with a reference device positions but
we pass in a rectangle which is derived a different way.
So, add a GetControlTextRect which operates on the same reference
device as DrawControlText so the rectangles match
The rectangle is mapped from pixels to logic and back from logic
to pixel, so add an argument to store the logic size from
GetControlTextRect and re-use it without conversion on the cases
where we pass back the original rectangle
zooming in/out on the button in writer is now stable wrt text shown at all zoom
levels
Change-Id: Ic581eca67d0ff265e2753ab8b6c40e8fca7e6ae4
Reviewed-on: https://gerrit.libreoffice.org/33277
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/vcl/ctrl.hxx')
-rw-r--r-- | include/vcl/ctrl.hxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx index 2f93f64ccc7b..c6b60ef48ace 100644 --- a/include/vcl/ctrl.hxx +++ b/include/vcl/ctrl.hxx @@ -85,8 +85,13 @@ protected: returning. */ Rectangle DrawControlText( OutputDevice& _rTargetDevice, const Rectangle& _rRect, - const OUString& _rStr, DrawTextFlags _nStyle, - MetricVector* _pVector, OUString* _pDisplayText ) const; + const OUString& _rStr, DrawTextFlags _nStyle, + MetricVector* _pVector, OUString* _pDisplayText, + const Size* i_pDeviceSize = nullptr ) const; + + Rectangle GetControlTextRect( OutputDevice& _rTargetDevice, const Rectangle & rRect, + const OUString& _rStr, DrawTextFlags _nStyle, + Size* o_pDeviceSize = nullptr ) const; virtual const vcl::Font& GetCanonicalFont( const StyleSettings& _rStyle ) const; |