1
0
Fork 0
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:
jules 2012-11-30 14:14:17 +00:00
parent 56097bf314
commit 3c83383d0e
2 changed files with 7 additions and 1 deletions

View file

@ -142,6 +142,12 @@ public:
*/
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. */
bool operator== (const Line& other) const noexcept { return start == other.start && end == other.end; }

View file

@ -358,7 +358,7 @@ void ScrollBar::mouseDrag (const MouseEvent& e)
{
const int mousePos = vertical ? e.y : e.x;
if (isDraggingThumb && lastMousePos != mousePos)
if (isDraggingThumb && lastMousePos != mousePos && thumbAreaSize > thumbSize)
{
const int deltaPixels = mousePos - dragStartMousePos;