mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-14 22:03:16 -06:00
Painter: Fixed issue with Text(..const char *..) (wrong length of text if n = -1)
git-svn-id: svn://ultimatepp.org/upp/trunk@5049 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
aa5fc95fb2
commit
e0d8cb9607
2 changed files with 8 additions and 7 deletions
|
|
@ -451,10 +451,12 @@ LRESULT Ctrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) {
|
|||
MINMAXINFO *mmi = (MINMAXINFO *)lParam;
|
||||
Rect frmrc = Size(200, 200);
|
||||
::AdjustWindowRect(frmrc, WS_OVERLAPPEDWINDOW, FALSE);
|
||||
Size msz = Ctrl::GetWorkArea().Deflated(-frmrc.left, -frmrc.top,
|
||||
frmrc.right - 200, frmrc.bottom - 200).GetSize();
|
||||
Rect minr(Point(50, 50), min(msz, GetMinSize()));
|
||||
Rect maxr(Point(50, 50), min(msz, GetMaxSize()));
|
||||
// Size msz = Ctrl::GetWorkArea().Deflated(-frmrc.left, -frmrc.top,
|
||||
// frmrc.right - 200, frmrc.bottom - 200).GetSize();
|
||||
// Rect minr(Point(50, 50), min(msz, GetMinSize()));
|
||||
// Rect maxr(Point(50, 50), min(msz, GetMaxSize())); // Removed cxl&nixnixnix 2012-6-12
|
||||
Rect minr(Point(50, 50), GetMinSize());
|
||||
Rect maxr(Point(50, 50), GetMaxSize());
|
||||
dword style = ::GetWindowLong(hwnd, GWL_STYLE);
|
||||
dword exstyle = ::GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||
AdjustWindowRectEx(minr, style, FALSE, exstyle);
|
||||
|
|
|
|||
|
|
@ -481,9 +481,8 @@ Painter& Painter::Text(double x, double y, const String& s, Font fnt, double *dx
|
|||
|
||||
Painter& Painter::Text(const Pointf& p, const char *text, Font fnt, int n, double *dx)
|
||||
{
|
||||
if(n < 0)
|
||||
n = strlen(text);
|
||||
return Text(p, ToUnicode(text, n, CHARSET_DEFAULT), fnt, n, dx);
|
||||
WString s = ToUnicode(text, CHARSET_DEFAULT);
|
||||
return Text(p, s, fnt, n < 0 ? s.GetCount() : n, dx);
|
||||
}
|
||||
|
||||
Painter& Painter::Text(double x, double y, const char *text, Font fnt, int n, double *dx)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue