MCPcopy Create free account
hub / github.com/MyGUI/mygui / notifyScrollChangePositionAlpha

Method notifyScrollChangePositionAlpha

Tools/EditorFramework/ColourPanel.cpp:386–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384 }
385
386 void ColourPanel::notifyScrollChangePositionAlpha(MyGUI::ScrollBar* _sender, size_t _position)
387 {
388 mCurrentColour.alpha = static_cast<float>(mAlphaSlider->getScrollPosition()) /
389 static_cast<float>(mAlphaSlider->getScrollRange() - 1);
390
391 if (mCurrentColour.alpha > 1)
392 mCurrentColour.alpha = 1;
393 else if (mCurrentColour.alpha < 0)
394 mCurrentColour.alpha = 0;
395
396 mInputAlpha->setCaption(MyGUI::utility::toString(mCurrentColour.alpha));
397 mColourView->setAlpha(mCurrentColour.alpha);
398
399 eventPreviewColour(mCurrentColour);
400 }
401
402 void ColourPanel::setAlphaSupport(bool _value)
403 {

Callers

nothing calls this directly

Calls 5

toStringFunction · 0.85
getScrollPositionMethod · 0.80
getScrollRangeMethod · 0.80
setCaptionMethod · 0.45
setAlphaMethod · 0.45

Tested by

no test coverage detected