mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 06:05:58 -06:00
Painter: Fixed problem with strlen in Text
This commit is contained in:
parent
588529a752
commit
81d79f3ed3
2 changed files with 3 additions and 2 deletions
|
|
@ -267,8 +267,8 @@ Painter& Painter::Text(double x, double y, const String& s, Font fnt, const doub
|
|||
|
||||
Painter& Painter::Text(const Pointf& p, const char *text, Font fnt, int n, const double *dx)
|
||||
{
|
||||
WString s = ToUtf32(text, n);
|
||||
return Text(p, s, fnt, n < 0 ? s.GetCount() : n, dx);
|
||||
WString s = ToUtf32(text, n < 0 ? strlen(text) : n);
|
||||
return Text(p, s, fnt, s.GetCount(), dx);
|
||||
}
|
||||
|
||||
Painter& Painter::Text(double x, double y, const char *text, Font fnt, int n, const double *dx)
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ struct MyApp : TopWindow {
|
|||
DrawPainter iw(w, GetSize());
|
||||
iw.Clear(SWhite());
|
||||
iw.DrawText(Zx(100), Zx(100), "Hello world!", (Font)~dl);
|
||||
iw.Text(Zx(100), Zx(200), "Hello world again!", (Font)~dl).Fill(Black());
|
||||
}
|
||||
|
||||
MyApp() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue