mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +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
|
// update shapes bbox (with empty path hadnling)
|
||||||
updateAABB(tr);
|
if ((this->meshGroupShapesBBox.meshes.count > 0 ) ||
|
||||||
meshDataBBox.update(context, pMin, pMax);
|
(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);
|
meshGroupShapes.release(context);
|
||||||
pMin = {FLT_MAX, FLT_MAX};
|
pMin = {FLT_MAX, FLT_MAX};
|
||||||
pMax = {0.0f, 0.0f};
|
pMax = {0.0f, 0.0f};
|
||||||
|
aabb = {0, 0, 0, 0};
|
||||||
clips.clear();
|
clips.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue