vg->bounds(&vx, &vy, &vw, &vh, false);
//According to: https://www.w3.org/TR/SVG11/coords.html#ObjectBoundingBoxUnits (the last paragraph)
//a stroke width should be ignored for bounding box calculations
- if (auto strokeHalfW = 0.5f * vg->strokeWidth()) {
- vx += strokeHalfW;
- vy += strokeHalfW;
- vw -= strokeHalfW;
- vh -= strokeHalfW;
+ if (auto strokeW = vg->strokeWidth()) {
+ vx += 0.5f * strokeW;
+ vy += 0.5f * strokeW;
+ vw -= strokeW;
+ vh -= strokeW;
}
}
//According to: https://www.w3.org/TR/SVG11/coords.html#ObjectBoundingBoxUnits (the last paragraph)
//a stroke width should be ignored for bounding box calculations
vg->bounds(&vx, &vy, &vw, &vh, false);
- if (auto strokeHalfW = 0.5f * vg->strokeWidth()) {
- vx += strokeHalfW;
- vy += strokeHalfW;
- vw -= strokeHalfW;
- vh -= strokeHalfW;
+ if (auto strokeW = vg->strokeWidth()) {
+ vx += 0.5f * strokeW;
+ vy += 0.5f * strokeW;
+ vw -= strokeW;
+ vh -= strokeW;
}
}