Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ internal CanvasImageSource RenderImageSource(IFontImageSource imageSource, float
var canvasImageSource = new CanvasImageSource(device, canvasWidth, canvasHeight, dpi);
using (var ds = canvasImageSource.CreateDrawingSession(UI.Colors.Transparent))
{
// offset by 1px as we added a 1px padding
var x = (layout.DrawBounds.X * -1) + 1;
var y = (layout.DrawBounds.Y * -1) + 1;
var x = (canvasWidth / 2d + (layout.LayoutBounds.Left + layout.DefaultFontSize / 2));
var y = (canvasHeight / 2d + (layout.LayoutBounds.Top + layout.DefaultFontSize / 2));

ds.DrawTextLayout(layout, (float)x, (float)y, color);
}
Expand Down Expand Up @@ -149,4 +148,4 @@ string GetFontSource(IFontImageSource imageSource)
return fontSource;
}
}
}
}
Loading