Skip to content
Merged
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
24 changes: 13 additions & 11 deletions Pinta.Tools/Tools/TextTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1029,22 +1029,24 @@ private void RedrawText (bool showCursor, bool useTextLayer)
g2.FillRectangle (CurrentTextLayout.GetLayoutBounds ().ToDouble (), CurrentTextEngine.SecondaryColor);
}

// Draw the text
if (FillText)
PangoCairo.Functions.ShowLayout (g, CurrentTextLayout.Layout);

if (FillText && StrokeText) {
g.SetSourceColor (CurrentTextEngine.SecondaryColor);
// Draws the text stroke
if (StrokeText) {
g.SetSourceColor (FillText ? CurrentTextEngine.SecondaryColor : CurrentTextEngine.PrimaryColor);
g.LineWidth = OutlineWidth;

PangoCairo.Functions.LayoutPath (g, CurrentTextLayout.Layout);
g.Stroke ();
} else if (StrokeText) {
g.SetSourceColor (CurrentTextEngine.PrimaryColor);
g.LineWidth = OutlineWidth;

PangoCairo.Functions.LayoutPath (g, CurrentTextLayout.Layout);
g.Stroke ();
// Position resets after g.Stroke ();
if (FillText) {
g.MoveTo (CurrentTextEngine.Origin.X, CurrentTextEngine.Origin.Y);
g.SetSourceColor (CurrentTextEngine.PrimaryColor);
}
}

// Draws the text fill
if (FillText) {
PangoCairo.Functions.ShowLayout (g, CurrentTextLayout.Layout);
}

if (showCursor) {
Expand Down