Bug #1959

Updated by Zbigniew Rebacz almost 5 years ago

Insert color dialog from TheIDE on my full hd monitor is cutted. Probably the problem is related to this method:
<pre>
void RGBACtrl::Layout()
{
Size sz = GetSize();
int ah = IconDesImg::Alpha().GetHeight() + 20;
int th = text.GetStdHeight(text.GetFont());
int eh = 4 - 20 - ah - th - 4;
int rh = min(sz.cx - (sz.cx >> 3), sz.cy - eh);
ramp.BottomPos(0, rh).HSizePos();
int y = sz.cy - rh - 4 - ah;
alpha.TopPos(y, ah).HSizePos(1, 0);
text.TopPos((y -= 4 + th), th).HSizePos(1, 0);
cbox.cx = (sz.cx - 3) / 18;
cbox.cy = minmax(cbox.cx, 4, Zy(16));
int ch = 14 * cbox.cy;
cs.x = (sz.cx - 18 * cbox.cx) / 2 + 1;
cs.y = (y -= ch + 4);
if(subctrl)
subctrl->TopPos(0, y - 4).HSizePos(1, 0);
}

// or this one:

void RGBACtrl::Paint(Draw& w)

{
w.DrawRect(GetSize(), SColorFace);
if(alpha.IsMask())
return;
for(int x = 0; x <= 18; x++)
w.DrawRect(x * cbox.cx + cs.x, cs.y, 1, cbox.cy * 14, SColorText());
int i = 0;
int my = cs.y + 1;
w.DrawRect(cs.x, cs.y + 14 * cbox.cy, cbox.cx * 18 + 1, 1, SColorText());
Point pp = Null;
for(int y = 0; y < 14; y++) {
w.DrawRect(cs.x, my - 1, cbox.cx * 18 + 1, 1, SColorText());
int mx = cs.x + 1;
for(int x = 0; x < 18; x++) {
Color c = GetColor(i++);
w.DrawRect(mx, my, cbox.cx - 1, cbox.cy - 1, c);
if(c == color)
pp = Point(mx, my);
mx += cbox.cx;
}
my += cbox.cy;
}
if(!IsNull(pp)) {
Size isz = CtrlImg::wheel_cursor().GetSize();
pp = pp + (cbox - isz) / 2;
w.DrawImage(pp.x, pp.y, CtrlImg::wheel_cursor(),
Grayscale(color) < 120 ? White() : Black());
}
}

</pre>

Back