1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

MSVC: Fix some potential divide-by-zero errors

This commit is contained in:
reuk 2020-03-26 11:17:09 +00:00
parent 4d496bc44f
commit dde6b96ebe
2 changed files with 4 additions and 4 deletions

View file

@ -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:

View file

@ -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);