Browse Source

Added Line::toFloat(). Fix for scrollbar edge-case.

tags/2021-05-28
jules 13 years ago
parent
commit
3c83383d0e
2 changed files with 7 additions and 1 deletions
  1. +6
    -0
      modules/juce_graphics/geometry/juce_Line.h
  2. +1
    -1
      modules/juce_gui_basics/layout/juce_ScrollBar.cpp

+ 6
- 0
modules/juce_graphics/geometry/juce_Line.h 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; }


+ 1
- 1
modules/juce_gui_basics/layout/juce_ScrollBar.cpp 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;


Loading…
Cancel
Save