diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-08 16:40:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-08 21:28:49 +0200 |
commit | 9e8c6c81f2f5d3df850353ee92a5b6e52546d6c6 (patch) | |
tree | c4154cdb1906ddd9098269cd9b81afaf04a63845 /tools/source | |
parent | 3e8989d47e3116a99d4b9f6d03800464ff235de8 (diff) |
make tools::Rectangle::expandBy respect empty state
and make non-inline so it is easy to disable this for debugging, if need
be
Change-Id: Ib383bb990ddcd835ff37e98893e44156287e0488
Reviewed-on: https://gerrit.libreoffice.org/75227
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/generic/gen.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index 3593801579ac..53bb2680c5c8 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -233,4 +233,19 @@ OString tools::Rectangle::toString() const return ss.str().c_str(); } +void tools::Rectangle::expand(long nExpandBy) +{ + nLeft -= nExpandBy; + nTop -= nExpandBy; + if (nRight == RECT_EMPTY) + nRight = nLeft + nExpandBy - 1; + else + nRight += nExpandBy; + if (nBottom == RECT_EMPTY) + nBottom = nTop + nExpandBy - 1; + else + nBottom += nExpandBy; +} + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |