The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.2KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. namespace juce
  14. {
  15. //==============================================================================
  16. /**
  17. A Drawable object which draws a rectangle.
  18. For details on how to change the fill and stroke, see the DrawableShape class.
  19. @see Drawable, DrawableShape
  20. @tags{GUI}
  21. */
  22. class JUCE_API DrawableRectangle : public DrawableShape
  23. {
  24. public:
  25. //==============================================================================
  26. DrawableRectangle();
  27. DrawableRectangle (const DrawableRectangle&);
  28. /** Destructor. */
  29. ~DrawableRectangle() override;
  30. //==============================================================================
  31. /** Sets the rectangle's bounds. */
  32. void setRectangle (Parallelogram<float> newBounds);
  33. /** Returns the rectangle's bounds. */
  34. Parallelogram<float> getRectangle() const noexcept { return bounds; }
  35. /** Returns the corner size to be used. */
  36. Point<float> getCornerSize() const noexcept { return cornerSize; }
  37. /** Sets a new corner size for the rectangle */
  38. void setCornerSize (Point<float> newSize);
  39. //==============================================================================
  40. /** @internal */
  41. std::unique_ptr<Drawable> createCopy() const override;
  42. private:
  43. Parallelogram<float> bounds;
  44. Point<float> cornerSize;
  45. void rebuildPath();
  46. DrawableRectangle& operator= (const DrawableRectangle&);
  47. JUCE_LEAK_DETECTOR (DrawableRectangle)
  48. };
  49. } // namespace juce