| 157 | } |
| 158 | |
| 159 | void ColourPanel::notifyScrollChangePosition(MyGUI::ScrollBar* _sender, size_t _position) |
| 160 | { |
| 161 | float sector_size = (float)mScrollRange->getScrollRange() / 6.0f; |
| 162 | float sector_current = (float)_position / sector_size; |
| 163 | |
| 164 | // current sector |
| 165 | size_t current = (size_t)sector_current; |
| 166 | assert(current < 6); |
| 167 | // смещение до следующего сектора от 0 до 1 |
| 168 | float offfset = (sector_current - (float)current); |
| 169 | |
| 170 | const MyGUI::Colour& from = mColourRange[current]; |
| 171 | const MyGUI::Colour& to = mColourRange[current + 1]; |
| 172 | |
| 173 | mBaseColour.red = from.red + offfset * (to.red - from.red); |
| 174 | mBaseColour.green = from.green + offfset * (to.green - from.green); |
| 175 | mBaseColour.blue = from.blue + offfset * (to.blue - from.blue); |
| 176 | |
| 177 | updateTexture(mBaseColour); |
| 178 | |
| 179 | MyGUI::IntPoint point( |
| 180 | mImageColourPicker->getLeft() + (mImageColourPicker->getWidth() / 2), |
| 181 | mImageColourPicker->getTop() + (mImageColourPicker->getHeight() / 2)); |
| 182 | |
| 183 | updateFromPoint(point); |
| 184 | } |
| 185 | |
| 186 | void ColourPanel::notifyEditTextChange(MyGUI::EditBox* _sender) |
| 187 | { |
nothing calls this directly
no test coverage detected