common picture: return bounding box size with the current image size.
authorHermet Park <chuneon.park@samsung.com>
Thu, 5 Aug 2021 05:57:18 +0000 (14:57 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Fri, 6 Aug 2021 01:04:08 +0000 (10:04 +0900)
if the picture has a bitmap-based image,
it can return the bounding box size with the current image size.

src/lib/tvgPictureImpl.h

index eb0edd9..4d329d3 100644 (file)
@@ -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)