From 8844bdd1e905a72b5698881443f8e0b1a642f5cf Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 5 Aug 2021 14:57:18 +0900 Subject: [PATCH] common picture: return bounding box size with the current image size. if the picture has a bitmap-based image, it can return the bounding box size with the current image size. --- src/lib/tvgPictureImpl.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/tvgPictureImpl.h b/src/lib/tvgPictureImpl.h index eb0edd9e..4d329d33 100644 --- a/src/lib/tvgPictureImpl.h +++ b/src/lib/tvgPictureImpl.h @@ -147,8 +147,10 @@ struct Picture::Impl bool bounds(float* x, float* y, float* w, float* h) const { - if (!paint) return false; - return paint->pImpl->bounds(x, y, w, h); + if (paint) return paint->pImpl->bounds(x, y, w, h); + if (w) *w = this->w; + if (h) *h = this->h; + return true; } RenderRegion bounds(RenderMethod& renderer)