Skip to content

Commit

Permalink
Reverse #2752 Logos are cut off on the left in OS_WIN
Browse files Browse the repository at this point in the history
Reverse #2752
Logos are no longer cut off on the left under OS_WIN32

https://forum.portfolio-performance.info/t/dark-mode-fur-pp/3739/75
  • Loading branch information
Nirus2000 committed Oct 29, 2023
1 parent 262efad commit e69906e
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href="https://github.com/portfolio-performance/portfolio/pull/2752">#2752</a>
*
* @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)
Expand Down

0 comments on commit e69906e

Please sign in to comment.