File tree 2 files changed +14
-4
lines changed
2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change
1
+ /build
2
+ * .user
Original file line number Diff line number Diff line change @@ -332,17 +332,25 @@ Matrix DomElement::getLocalTransform() const
332
332
333
333
Matrix DomElement::getAbsoluteTransform () const
334
334
{
335
- return getLocalTransform ();
335
+ if (m_element == nullptr || !m_element->box ())
336
+ return Matrix ();
337
+ auto transform = m_element->box ()->localTransform ();
338
+ for (auto currentElement = m_element->parent (); currentElement; currentElement = currentElement->parent ()) {
339
+ if (auto box = currentElement->box ()) {
340
+ transform.postmultiply (box->localTransform ());
341
+ }
342
+ }
343
+
344
+ return transform;
336
345
}
337
346
338
- Bitmap DomElement::renderToBitmap (std::uint32_t width, std::uint32_t height, std::uint32_t backgroundColor) const {
347
+ Bitmap DomElement::renderToBitmap (std::uint32_t width, std::uint32_t height, std::uint32_t backgroundColor) const
348
+ {
339
349
if (m_element == nullptr || !m_element->box ())
340
350
return Bitmap ();
341
-
342
351
auto elementBounds = m_element->box ()->map (m_element->box ()->strokeBoundingBox ());
343
352
if (elementBounds.empty ())
344
353
return Bitmap ();
345
-
346
354
if (width == 0 && height == 0 ) {
347
355
width = static_cast <std::uint32_t >(std::ceil (elementBounds.w ));
348
356
height = static_cast <std::uint32_t >(std::ceil (elementBounds.h ));
You can’t perform that action at this time.
0 commit comments