diff --git a/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp b/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp index 9306a1c88e..bdfc4f5fa6 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp +++ b/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp @@ -176,8 +176,8 @@ public: void paint (Graphics& g) override { g.setOpacity (1.0f); - g.drawImageTransformed (image, AffineTransform::scale (getWidth() / (float) image.getWidth(), - getHeight() / (float) image.getHeight()), false); + g.drawImageTransformed (image, AffineTransform::scale (getWidth() / (float) jmax (1, image.getWidth()), + getHeight() / (float) jmax (1, image.getHeight())), false); } private: diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index 1a7ea4bee3..173074fd56 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -4641,8 +4641,8 @@ void* CustomMouseCursorInfo::create() const { im = im.rescaled (maxW, maxH); - hotspotX = (hotspotX * maxW) / image.getWidth(); - hotspotY = (hotspotY * maxH) / image.getHeight(); + hotspotX = (hotspotX * maxW) / juce::jmax (1, image.getWidth()); + hotspotY = (hotspotY * maxH) / juce::jmax (1, image.getHeight()); } return IconConverters::createHICONFromImage (im, FALSE, hotspotX, hotspotY);