BColorControl: Introduce kRampCount magic constant.

This commit is contained in:
John Scipione
2013-06-10 19:15:09 -04:00
parent 8b3b14fdfa
commit da6c116d63
+2 -1
View File
@@ -43,6 +43,7 @@ static const float kSelectorHSpacing = 2.0f;
static const float kTextFieldsHSpacing = 6.0f;
static const float kDefaultFontSize = 12.0f;
static const float kBevelSpacing = 2.0f;
static const uint32 kRampCount = 4;
BColorControl::BColorControl(BPoint leftTop, color_control_layout layout,
@@ -608,7 +609,7 @@ BColorControl::_PaletteFrame() const
BRect
BColorControl::_RampFrame(uint8 rampIndex) const
{
float rampHeight = float(fRows) * fCellSize / 4.0f;
float rampHeight = (float)(fRows * fCellSize / kRampCount);
return BRect(fPaletteFrame.left,
fPaletteFrame.top + float(rampIndex) * rampHeight,