What if Magnify displayed a hex color instead of a useless index?
Well now it does. The code needs much more love, but I fixed the coding violations in this code I touched.
This commit is contained in:
parent
16e4281d0a
commit
477a6b7bfb
@ -909,17 +909,14 @@ TInfoView::Draw(BRect updateRect)
|
|||||||
strcpy(fInfoStr, dimensionsInfo);
|
strcpy(fInfoStr, dimensionsInfo);
|
||||||
DrawString(fInfoStr);
|
DrawString(fInfoStr);
|
||||||
|
|
||||||
rgb_color c = { 0,0,0, 255 };
|
rgb_color color = { 0, 0, 0, 255 };
|
||||||
uchar index = 0;
|
if (fMagView)
|
||||||
if (fMagView) {
|
color = fMagView->SelectionColor();
|
||||||
c = fMagView->SelectionColor();
|
|
||||||
BScreen s;
|
|
||||||
index = s.IndexForColor(c);
|
|
||||||
}
|
|
||||||
MovePenTo(10, fFontHeight*2+5);
|
|
||||||
char str[64];
|
char str[64];
|
||||||
sprintf(str, "R: %i G: %i B: %i (0x%x)",
|
snprintf(str, sizeof(str), "R: %i G: %i B: %i (#%02x%02x%02x)",
|
||||||
c.red, c.green, c.blue, index);
|
color.red, color.green, color.blue, color.red, color.green, color.red);
|
||||||
|
|
||||||
|
MovePenTo(10, fFontHeight*2+5);
|
||||||
invalRect.Set(10, fFontHeight+7, 10 + StringWidth(fRGBStr), fFontHeight*2+7);
|
invalRect.Set(10, fFontHeight+7, 10 + StringWidth(fRGBStr), fFontHeight*2+7);
|
||||||
SetHighColor(ViewColor());
|
SetHighColor(ViewColor());
|
||||||
FillRect(invalRect);
|
FillRect(invalRect);
|
||||||
|
Loading…
Reference in New Issue
Block a user