* Painter: fixed issue with subpixe (RM #281), Core: AsString(RGBA), CtrlCore: NoLayoutZoom fix for MSC

git-svn-id: svn://ultimatepp.org/upp/trunk@5026 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2012-05-31 09:18:29 +00:00
parent 3d88cdb997
commit ea19869432
5 changed files with 12 additions and 3 deletions

View file

@ -60,6 +60,12 @@ dword Color::Get() const
return c & 0xffffff; 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 Color::operator RGBA() const
{ {
RGBA color; RGBA color;

View file

@ -16,6 +16,9 @@ struct RGBA : Moveable<RGBA> {
#endif #endif
#endif #endif
template <>
String AsString(const RGBA& c);
#ifndef PLATFORM_WIN32 #ifndef PLATFORM_WIN32
inline int GetRValue(dword c) { return (byte)(c >> 0); } inline int GetRValue(dword c) { return (byte)(c >> 0); }
inline int GetGValue(dword c) { return (byte)(c >> 8); } inline int GetGValue(dword c) { return (byte)(c >> 8); }

View file

@ -740,7 +740,7 @@ void Ctrl::NoLayoutZoom()
{ {
GuiLock __; GuiLock __;
IsNoLayoutZoom = true; IsNoLayoutZoom = true;
Csize = Dsize = 1; Csize = Dsize = Size(1, 1);
ReSkin(); ReSkin();
} }

View file

@ -42,7 +42,7 @@ void ImageBuffer::Create(int cx, int cy)
while(s < e) { while(s < e) {
s->a = a; s->a = a;
a = ~a; a = ~a;
s->r = 255; s->r = a ? 255 : 0;
s->g = s->b = 0; s->g = s->b = 0;
s++; s++;
} }

View file

@ -270,7 +270,7 @@ void SubpixelFiller::Write(int len)
RGBA c = ss ? Mul8(*s++, alpha) : invert ? InvertRGBA(*t) : color; RGBA c = ss ? Mul8(*s++, alpha) : invert ? InvertRGBA(*t) : color;
int a; int a;
if(t->a != 255) if(t->a != 255)
AlphaBlendCover8(*t, c, (q[0] + q[1] + q[2]) / 3); AlphaBlend(*t, c);
else else
if(c.a == 255) { if(c.a == 255) {
t->r = (c.r * q[0] >> 8) + ((257 - q[0]) * t->r >> 8); t->r = (c.r * q[0] >> 8) + ((257 - q[0]) * t->r >> 8);