From f28ff72d5ffb77c7402c736c3eb3ce22c1b59654 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 15 Sep 2013 17:50:42 +0000 Subject: [PATCH] Draw: SDraw improvements git-svn-id: svn://ultimatepp.org/upp/trunk@6349 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Draw/SDrawClip.cpp | 4 ++-- uppsrc/Draw/SDrawPut.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/uppsrc/Draw/SDrawClip.cpp b/uppsrc/Draw/SDrawClip.cpp index ec7976c8e..7b3c5d4ca 100644 --- a/uppsrc/Draw/SDrawClip.cpp +++ b/uppsrc/Draw/SDrawClip.cpp @@ -4,10 +4,10 @@ NAMESPACE_UPP void SDraw::Init(const Rect& r) { - Cy(r.GetWidth()); + Cy(r.GetHeight()); Cloff& c = cloff.Add(); c.clip.Add(r); - c.offset = Point(0, 0); + c.offset = r.TopLeft(); } void SDraw::BeginOp() diff --git a/uppsrc/Draw/SDrawPut.cpp b/uppsrc/Draw/SDrawPut.cpp index d16df6992..6e8da9522 100644 --- a/uppsrc/Draw/SDrawPut.cpp +++ b/uppsrc/Draw/SDrawPut.cpp @@ -50,6 +50,8 @@ void SDraw::SysDrawImageOp(int x, int y, const Image& img, Color color) void SDraw::DrawRectOp(int x, int y, int cx, int cy, Color color) { + if(IsNull(color)) + return; Rect r = RectC(x, y, cx, cy); r += cloff.Top().offset; const Vector& clip = cloff.Top().clip;