mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Painter: DrawImageOp completed to implement all original Draw modes
git-svn-id: svn://ultimatepp.org/upp/trunk@1951 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
202b0a1ccb
commit
d58101e4ed
2 changed files with 671 additions and 669 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -64,15 +64,16 @@ void Painter::DrawRectOp(int x, int y, int cx, int cy, Color color)
|
|||
Fill(color);
|
||||
}
|
||||
|
||||
void Painter::DrawImageOp(int x, int y, int cx, int cy, const Image& img, const Rect& src, Color color)
|
||||
void Painter::DrawImageOp(int x, int y, int cx, int cy, const Image& image, const Rect& src, Color color)
|
||||
{
|
||||
// Color and src support!!!
|
||||
Image img = IsNull(color) ? image : SetColorKeepAlpha(image, color);
|
||||
RectPath(x, y, cx, cy);
|
||||
Sizef sz = img.GetSize();
|
||||
Fill(img, Xform2D::Scale(cx / sz.cx, cy / sz.cy) * Xform2D::Translation(x, y));
|
||||
double sw = (double)cx / src.GetWidth();
|
||||
double sh = (double)cy / src.GetHeight();
|
||||
Fill(img, Xform2D::Scale(sw, sh) * Xform2D::Translation(x - sw * src.left, y - sh * src.top));
|
||||
}
|
||||
|
||||
|
||||
void Painter::DrawLineStroke(int width, Color color)
|
||||
{
|
||||
Begin();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue