diff --git a/uppsrc/Core/Color.cpp b/uppsrc/Core/Color.cpp index 2d0fc06cd..03d17ea84 100644 --- a/uppsrc/Core/Color.cpp +++ b/uppsrc/Core/Color.cpp @@ -60,6 +60,12 @@ dword Color::Get() const return c & 0xffffff; } +template <> +String AsString(const RGBA& c) +{ + return Format("RGBA(%d, %d, %d, %d)", (int)c.r, (int)c.g, (int)c.b, (int)c.a); +} + Color::operator RGBA() const { RGBA color; diff --git a/uppsrc/Core/Color.h b/uppsrc/Core/Color.h index 0af316a92..6cd14d723 100644 --- a/uppsrc/Core/Color.h +++ b/uppsrc/Core/Color.h @@ -16,6 +16,9 @@ struct RGBA : Moveable { #endif #endif +template <> +String AsString(const RGBA& c); + #ifndef PLATFORM_WIN32 inline int GetRValue(dword c) { return (byte)(c >> 0); } inline int GetGValue(dword c) { return (byte)(c >> 8); } diff --git a/uppsrc/CtrlCore/Ctrl.cpp b/uppsrc/CtrlCore/Ctrl.cpp index 7d1b3f285..aeefef21f 100644 --- a/uppsrc/CtrlCore/Ctrl.cpp +++ b/uppsrc/CtrlCore/Ctrl.cpp @@ -740,7 +740,7 @@ void Ctrl::NoLayoutZoom() { GuiLock __; IsNoLayoutZoom = true; - Csize = Dsize = 1; + Csize = Dsize = Size(1, 1); ReSkin(); } diff --git a/uppsrc/Draw/Image.cpp b/uppsrc/Draw/Image.cpp index 3a31a9977..7e37e3577 100644 --- a/uppsrc/Draw/Image.cpp +++ b/uppsrc/Draw/Image.cpp @@ -42,7 +42,7 @@ void ImageBuffer::Create(int cx, int cy) while(s < e) { s->a = a; a = ~a; - s->r = 255; + s->r = a ? 255 : 0; s->g = s->b = 0; s++; } diff --git a/uppsrc/Painter/Fillers.cpp b/uppsrc/Painter/Fillers.cpp index 77cc22386..7c6240b3c 100644 --- a/uppsrc/Painter/Fillers.cpp +++ b/uppsrc/Painter/Fillers.cpp @@ -270,7 +270,7 @@ void SubpixelFiller::Write(int len) RGBA c = ss ? Mul8(*s++, alpha) : invert ? InvertRGBA(*t) : color; int a; if(t->a != 255) - AlphaBlendCover8(*t, c, (q[0] + q[1] + q[2]) / 3); + AlphaBlend(*t, c); else if(c.a == 255) { t->r = (c.r * q[0] >> 8) + ((257 - q[0]) * t->r >> 8);