Ticket #503: patch-bug#503.diff
File patch-bug#503.diff, 1.6 KB (added by , 16 years ago) |
---|
-
src/kits/interface/ColorControl.cpp
222 222 c2.blue = (value & 0x0000FF00) >> 8; 223 223 char string[4]; 224 224 225 // values for calculating the selector rectangles for invalidation 226 // analogous to selector drawing in _DrawColorArea 227 float rampXGradient = (ceil(fColumns * fCellSize) - 4 - 7) / 255; 228 float rampSize = (Bounds().bottom - 2) / 4.0; 229 float x, y; 230 225 231 if (c1.red != c2.red) { 226 232 sprintf(string, "%d", c2.red); 227 233 fRedText->SetText(string); 234 235 y = rampSize * 1.5; 236 x = 2 + c1.red * rampXGradient; 237 Invalidate(BRect(x - 2, y - 2, x + 6, y + 6)); 238 x = 2 + c2.red * rampXGradient; 239 Invalidate(BRect(x - 2, y - 2, x + 6, y + 6)); 228 240 } 229 241 230 242 if (c1.green != c2.green) { 231 243 sprintf(string, "%d", c2.green); 232 244 fGreenText->SetText(string); 245 246 y = rampSize * 2.5; 247 x = 2 + c1.green * rampXGradient; 248 Invalidate(BRect(x - 2, y - 2, x + 6, y + 6)); 249 x = 2 + c2.green * rampXGradient; 250 Invalidate(BRect(x - 2, y - 2, x + 6, y + 6)); 233 251 } 234 235 252 if (c1.blue != c2.blue) { 236 253 sprintf(string, "%d", c2.blue); 237 254 fBlueText->SetText(string); 255 256 y = rampSize * 3.5; 257 x = 2 + c1.blue * rampXGradient; 258 Invalidate(BRect(x - 2, y - 2, x + 6, y + 6)); 259 x = 2 + c2.blue * rampXGradient; 260 Invalidate(BRect(x - 2, y - 2, x + 6, y + 6)); 238 261 } 239 262 240 263 BControl::SetValueNoUpdate(value); 241 264 242 // TODO: This causes lot of flickering243 Invalidate();244 245 265 if (LockLooper()) { 246 266 Window()->UpdateIfNeeded(); 247 267 UnlockLooper();