mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
Developing HiDPI support
git-svn-id: svn://ultimatepp.org/upp/trunk@8791 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
06f30bcaf3
commit
b9e5b1c424
19 changed files with 64 additions and 64 deletions
|
|
@ -130,6 +130,8 @@ Value ChBorder(const ColorF *colors, const Value& face)
|
|||
return RawToValue(b);
|
||||
}
|
||||
|
||||
Image DPI(const Image& img, int excy = 16);
|
||||
|
||||
Value StdChLookFn(Draw& w, const Rect& r, const Value& v, int op)
|
||||
{
|
||||
if(IsType<sChLookWith>(v)) {
|
||||
|
|
@ -137,14 +139,15 @@ Value StdChLookFn(Draw& w, const Rect& r, const Value& v, int op)
|
|||
if(op == LOOK_PAINT) {
|
||||
LOGPNG(AsString(x.img.GetSerialId()), x.img);
|
||||
ChPaint(w, r, x.look);
|
||||
Point p = r.CenterPos(x.img.GetSize()) + x.offset;
|
||||
Image m = DPI(x.img);
|
||||
Point p = r.CenterPos(m.GetSize()) + x.offset;
|
||||
if(x.colorfn)
|
||||
w.DrawImage(p.x, p.y, x.img, (*x.colorfn)(x.ii));
|
||||
w.DrawImage(p.x, p.y, m, (*x.colorfn)(x.ii));
|
||||
else
|
||||
if(!IsNull(x.color))
|
||||
w.DrawImage(p.x, p.y, x.img, x.color);
|
||||
w.DrawImage(p.x, p.y, m, x.color);
|
||||
else
|
||||
w.DrawImage(p.x, p.y, x.img);
|
||||
w.DrawImage(p.x, p.y, m);
|
||||
return 1;
|
||||
}
|
||||
return sChOp(w, r, x.look, op);
|
||||
|
|
@ -183,6 +186,7 @@ Value StdChLookFn(Draw& w, const Rect& r, const Value& v, int op)
|
|||
}
|
||||
if(IsType<Image>(v)) {
|
||||
Image img = v;
|
||||
img = DPI(img);
|
||||
Size isz = img.GetSize();
|
||||
Size sz = r.GetSize();
|
||||
Point p = img.GetHotSpot();
|
||||
|
|
|
|||
Loading…
Reference in a new issue