Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions windows/RNSVG/TSpanView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ void TSpanView::CreateGeometry(UI::Xaml::CanvasControl const &canvas) {

void TSpanView::Render(UI::Xaml::CanvasControl const &canvas, CanvasDrawingSession const &session) {
auto const &transform{session.Transform()};
bool translateXY{X().Size() > 0 || Y().Size() > 0};
bool translateXY{X().Size() > 0 || Y().Size() > 0 || DX().Size() > 0 || DY().Size() > 0};

if (translateXY) {
float x{X().Size() > 0 ? X().GetAt(0).Value() : 0};
float y{Y().Size() > 0 ? Y().GetAt(0).Value() : 0};
session.Transform(transform * Numerics::make_float3x2_translation(x, y));
float dx{DX().Size() > 0 ? DX().GetAt(0).Value() : 0};
float dy{DY().Size() > 0 ? DY().GetAt(0).Value() : 0};
session.Transform(transform * Numerics::make_float3x2_translation(x + dx, y + dy));
}
__super::Render(canvas, session);
if (translateXY) {
Expand Down
6 changes: 4 additions & 2 deletions windows/RNSVG/TextView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ void TextView::UpdateProperties(IJSValueReader const &reader, bool forceUpdate,

void TextView::RenderGroup(UI::Xaml::CanvasControl const &canvas, CanvasDrawingSession const &session) {
auto const &transform{session.Transform()};
bool translateXY{X().Size() > 0 || Y().Size() > 0};
bool translateXY{X().Size() > 0 || Y().Size() > 0 || DX().Size() > 0 || DY().Size() > 0};
if (translateXY) {
float x{X().Size() > 0 ? X().GetAt(0).Value() : 0};
float y{Y().Size() > 0 ? Y().GetAt(0).Value() : 0};
session.Transform(transform * Numerics::make_float3x2_translation(x, y));
float dx{DX().Size() > 0 ? DX().GetAt(0).Value() : 0};
float dy{DY().Size() > 0 ? DY().GetAt(0).Value() : 0};
session.Transform(transform * Numerics::make_float3x2_translation(x + dx, y + dy));
}
__super::RenderGroup(canvas, session);
if (translateXY) {
Expand Down