mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
wg_engine: fix empty shape aabb handling
see https://github.com/thorvg/thorvg/issues/2843:
This commit is contained in:
parent
0c08dab32f
commit
c926eebba1
1 changed files with 7 additions and 3 deletions
|
@ -411,9 +411,12 @@ void WgRenderDataShape::updateMeshes(WgContext &context, const RenderShape &rsha
|
|||
});
|
||||
}
|
||||
}
|
||||
// update shapes bbox
|
||||
updateAABB(tr);
|
||||
meshDataBBox.update(context, pMin, pMax);
|
||||
// update shapes bbox (with empty path hadnling)
|
||||
if ((this->meshGroupShapesBBox.meshes.count > 0 ) ||
|
||||
(this->meshGroupStrokesBBox.meshes.count > 0)) {
|
||||
updateAABB(tr);
|
||||
meshDataBBox.update(context, pMin, pMax);
|
||||
} else aabb = {0, 0, 0, 0};
|
||||
}
|
||||
|
||||
|
||||
|
@ -450,6 +453,7 @@ void WgRenderDataShape::releaseMeshes(WgContext &context)
|
|||
meshGroupShapes.release(context);
|
||||
pMin = {FLT_MAX, FLT_MAX};
|
||||
pMax = {0.0f, 0.0f};
|
||||
aabb = {0, 0, 0, 0};
|
||||
clips.clear();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue