diff --git a/name.abuchen.portfolio/src/name/abuchen/portfolio/model/ImageManager.java b/name.abuchen.portfolio/src/name/abuchen/portfolio/model/ImageManager.java index c84ad325e5..88ac545a95 100644 --- a/name.abuchen.portfolio/src/name/abuchen/portfolio/model/ImageManager.java +++ b/name.abuchen.portfolio/src/name/abuchen/portfolio/model/ImageManager.java @@ -22,12 +22,37 @@ private ImageManager() { } + /** + * Retrieves an image associated with the given Attributable and AttributeType. + * If not found, a default image is returned. + * + * @implNote For some time, Windows cut off the logos on the left. + * An offset was added with #2752 In the meantime the problem seems to be fixed, + * so we set the offset to 0 again. + * + * @see #2752 + * + * @param target The Attributable object to retrieve the image for. + * @param attr The AttributeType specifying the image. + * @return The retrieved image or null if not found. + */ public Image getImage(Attributable target, AttributeType attr) { - int xOffset = Platform.OS_WIN32.equals(Platform.getOS()) ? 1 : 0; + int xOffset = Platform.OS_WIN32.equals(Platform.getOS()) ? 0 : 0; return getImage(target, attr, xOffset, 16, 16); } + /** + * Retrieves an image associated with the given Attributable, AttributeType, and additional parameters. + * If not found, a default image is returned. + * + * @param target The Attributable object to retrieve the image for. + * @param attr The AttributeType specifying the image. + * @param xOffset The horizontal offset for the image. + * @param width The width of the image. + * @param height The height of the image. + * @return The retrieved image or null if not found. + */ public Image getImage(Attributable target, AttributeType attr, int xOffset, int width, int height) { if (target != null && target.getAttributes().exists(attr) && attr.getConverter() instanceof ImageConverter)