diff --git a/uppsrc/Draw/MakeCache.cpp b/uppsrc/Draw/MakeCache.cpp index c3eb6239e..f0f58edee 100644 --- a/uppsrc/Draw/MakeCache.cpp +++ b/uppsrc/Draw/MakeCache.cpp @@ -24,7 +24,9 @@ struct scImageMaker : LRUCache::Maker { bool paintonly; virtual String Key() const { - return m->Key(); + String s = m->Key(); + s.Cat(paintonly ? '1' : '0'); + return s; } virtual int Make(Image& object) const { object = m->Make(); diff --git a/uppsrc/Draw/SDraw.h b/uppsrc/Draw/SDraw.h index 725e48403..a686fba72 100644 --- a/uppsrc/Draw/SDraw.h +++ b/uppsrc/Draw/SDraw.h @@ -33,6 +33,8 @@ private: void operator<<=(const Cloff& b) { clip <<= b.clip; offset = b.offset; } }; + bool paintonly; + Array cloff; Color docolor; @@ -47,6 +49,10 @@ public: void Init(const Rect& r); void Init(const Vector& rs, int height, Point offset = Point(0, 0)); + + void PaintOnly() { paintonly = true; } + + SDraw() { paintonly = false; } }; class SImageDraw1 : public SDraw { diff --git a/uppsrc/Draw/SDrawPut.cpp b/uppsrc/Draw/SDrawPut.cpp index 8448de04b..faeaee2fe 100644 --- a/uppsrc/Draw/SDrawPut.cpp +++ b/uppsrc/Draw/SDrawPut.cpp @@ -4,7 +4,8 @@ NAMESPACE_UPP void SDraw::PutImage(Point p, const Image& img, const Rect& src, Color color) { - PutImage(p, CachedSetColorKeepAlphaPaintOnly(img, color), src); + PutImage(p, (paintonly ? CachedSetColorKeepAlphaPaintOnly : CachedSetColorKeepAlpha) + (img, color), src); } void SDraw::SysDrawImageOp(int x, int y, const Image& img, const Rect& src, Color color) diff --git a/uppsrc/Draw/SDrawText.cpp b/uppsrc/Draw/SDrawText.cpp index d56bb2fae..b667215f6 100644 --- a/uppsrc/Draw/SDrawText.cpp +++ b/uppsrc/Draw/SDrawText.cpp @@ -59,14 +59,22 @@ void SDraw::DrawTextOp(int x, int y, int angle, const wchar *text, Font font, Co if(font.GetHeight() > 200) { int bn = font[g.chr] + font.GetLineHeight(); for(g.yy = 0; g.yy < bn; g.yy += 32) { - Image m = MakeImagePaintOnly(g); + Image m; + if(paintonly) + m = MakeImagePaintOnly(g); + else + m = MakeImage(g); Point h = m.GetHotSpot(); SysDrawImageOp(x - h.x, y + g.yy - h.y, m, m.GetSize(), ink); } } else { g.yy = Null; - Image m = MakeImagePaintOnly(g); + Image m; + if(paintonly) + m = MakeImagePaintOnly(g); + else + m = MakeImage(g); Point h = m.GetHotSpot(); SysDrawImageOp(x - h.x, y - h.y, m, m.GetSize(), ink); } diff --git a/uppsrc/Turtle/Turtle.h b/uppsrc/Turtle/Turtle.h index 1a645efc4..37d8b98fe 100644 --- a/uppsrc/Turtle/Turtle.h +++ b/uppsrc/Turtle/Turtle.h @@ -89,7 +89,7 @@ public: bool CanSetSurface() { return false; } static void Flush() {} - SystemDraw() { pos = Point(0, 0); } + SystemDraw() { pos = Point(0, 0); PaintOnly(); } }; struct BackDraw__ : public SystemDraw {