diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-09 13:33:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-09 14:36:02 +0200 |
commit | 77ca41321193ddfaa0ca05d1fa43f3b614209a61 (patch) | |
tree | dfd613d15efc25142b38a23b8c61c90826f70c91 /tools | |
parent | 98df07a89dbdef020c7cd849861c5aa426021153 (diff) |
make tools::Rectangle::shrink respect empty state
and make non-inline so it is easy to disable this for debugging, if need
be
Change-Id: Id529037e82b2fdd8c2120877a44fc7e069fc8406
Reviewed-on: https://gerrit.libreoffice.org/75298
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/generic/gen.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index 53bb2680c5c8..020be91ac3c0 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -247,5 +247,16 @@ void tools::Rectangle::expand(long nExpandBy) nBottom += nExpandBy; } +void tools::Rectangle::shrink(long nShrinkBy) +{ + nLeft += nShrinkBy; + nTop += nShrinkBy; + if (nRight != RECT_EMPTY) + nRight -= nShrinkBy; + if (nBottom != RECT_EMPTY) + nBottom -= nShrinkBy; +} + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |