mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix IAE
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -294,8 +294,13 @@ public class ImageLoader implements Serializable {
|
||||
|
||||
@NotNull
|
||||
private static Image scaleImage(Image image, float scale) {
|
||||
int width = (int)(scale * image.getWidth(null));
|
||||
int height = (int)(scale * image.getHeight(null));
|
||||
int w = image.getWidth(null);
|
||||
int h = image.getHeight(null);
|
||||
if (w <= 0 || h <= 0) {
|
||||
return image;
|
||||
}
|
||||
int width = (int)(scale * w);
|
||||
int height = (int)(scale * h);
|
||||
// Using "QUALITY" instead of "ULTRA_QUALITY" results in images that are less blurry
|
||||
// because ultra quality performs a few more passes when scaling, which introduces blurriness
|
||||
// when the scaling factor is relatively small (i.e. <= 3.0f) -- which is the case here.
|
||||
|
||||
Reference in New Issue
Block a user