Resolves: fdo#87189 don't draw negative canvas sizes

Change-Id: Ia52bc54084883817ffdd8ade06c3079865d52f70
(cherry picked from commit 6624484a608ed43fdeea1596f254915add671e08)
(cherry picked from commit 63a2168a6ea783d2c3824cdde8983dbfad147417)
Reviewed-on: https://gerrit.libreoffice.org/13414
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>