mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added Line::toFloat(). Fix for scrollbar edge-case.
This commit is contained in:
parent
56097bf314
commit
3c83383d0e
2 changed files with 7 additions and 1 deletions
|
|
@ -142,6 +142,12 @@ public:
|
||||||
*/
|
*/
|
||||||
typename Point<ValueType>::FloatType getAngle() const noexcept { return start.getAngleToPoint (end); }
|
typename Point<ValueType>::FloatType getAngle() const noexcept { return start.getAngleToPoint (end); }
|
||||||
|
|
||||||
|
/** Casts this line to float coordinates. */
|
||||||
|
Line<float> toFloat() const noexcept { return Line<float> (start.toFloat(), end.toFloat()); }
|
||||||
|
|
||||||
|
/** Casts this line to double coordinates. */
|
||||||
|
Line<double> toDouble() const noexcept { return Line<double> (start.toDouble(), end.toDouble()); }
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
/** Compares two lines. */
|
/** Compares two lines. */
|
||||||
bool operator== (const Line& other) const noexcept { return start == other.start && end == other.end; }
|
bool operator== (const Line& other) const noexcept { return start == other.start && end == other.end; }
|
||||||
|
|
|
||||||
|
|
@ -358,7 +358,7 @@ void ScrollBar::mouseDrag (const MouseEvent& e)
|
||||||
{
|
{
|
||||||
const int mousePos = vertical ? e.y : e.x;
|
const int mousePos = vertical ? e.y : e.x;
|
||||||
|
|
||||||
if (isDraggingThumb && lastMousePos != mousePos)
|
if (isDraggingThumb && lastMousePos != mousePos && thumbAreaSize > thumbSize)
|
||||||
{
|
{
|
||||||
const int deltaPixels = mousePos - dragStartMousePos;
|
const int deltaPixels = mousePos - dragStartMousePos;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue