diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-06-04 21:29:30 -0400 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2016-06-17 23:32:29 +0000 |
commit | 9d6f4cf26e59b846bcdf4139c6aeb76db5a554f7 (patch) | |
tree | c750cf2cecc153ef54534c6b43c030d69afa83ac /sc/source/ui | |
parent | 9113f17e65b1dafbc178fd269e2967c1e2632f0e (diff) |
LOK: fast tile rendering (graphics and buttons)
Since embedded graphics and buttons use
absolute coordinates, we set the origin
to be the top-left corner of the tile.
This includes the origin + ScrPos (see
previous patch).
Then, the coordinates of the graphic is
shifted by this amount to make sure it
renders in its relative position to the tile.
This renders embedded graphics and buttons
at their correct position, with some limitations.
Tiles large enough to cover a graphic object
show the graphic object where it should be.
However, rendering a relatively small tile
doesn't render the graphic. This seems to be
an issue with moving the graphic's coordinate
at a later stage than the 2D Processor decides
what objects intersect with the 'view area'
that is rendered.
Another issue is that graphs don't render.
What they seem to suffer is incorrect scale
and a fix coordinates (they show up as tiny
thumbnails at the top-left corner and grow
in proportion to the real graph when resized).
These shall be addressed in a separate patch.
Reviewed-on: https://gerrit.libreoffice.org/26204
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 5f01d80f75dc86b393cc2fdb66b94aece964c674)
Change-Id: I4b71bf5f2e357d1114d46022bc00905ceed0c2f9
Reviewed-on: https://gerrit.libreoffice.org/26376
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 315fba7bdfce..fb2a9c147953 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -821,6 +821,9 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI auto aOrigin = aOriginalMode.GetOrigin(); aOrigin.setX(aOrigin.getX() / TWIPS_PER_PIXEL + nScrX); aOrigin.setY(aOrigin.getY() / TWIPS_PER_PIXEL + nScrY); + static const double twipFactor = 15 * 1.76388889; // 26.45833335 + aOrigin = Point(aOrigin.getX() - aOrigin.getX() / twipFactor, + aOrigin.getY() - aOrigin.getY() / twipFactor); aNew.SetOrigin(aOrigin); pContentDev->SetMapMode(aNew); } |