Skip to content

Commit

Permalink
FlatSVGIcon: added copy constructor (issue #465)
Browse files Browse the repository at this point in the history
  • Loading branch information
DevCharly committed Jan 24, 2022
1 parent 751c0e1 commit 97bed85
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ FlatLaf Change Log
- ToolTip: Fixed wrong tooltip location if component overrides
`JComponent.getToolTipLocation()` and wants place tooltip under mouse
location. (issue #468)
- Extras: Added copy constructor to `FlatSVGIcon`. (issue #465)


## 2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,20 @@ private static synchronized URI loadFromStream( InputStream in ) throws IOExcept
}
}

/**
* Creates a copy of the given icon.
* <p>
* If the icon has a color filter, then it is shared with the new icon.
*
* @since 2.0.1
*/
public FlatSVGIcon( FlatSVGIcon icon ) {
this( icon.name, icon.width, icon.height, icon.scale, icon.disabled, icon.classLoader, icon.uri );
colorFilter = icon.colorFilter;
diagram = icon.diagram;
dark = icon.dark;
}

protected FlatSVGIcon( String name, int width, int height, float scale, boolean disabled, ClassLoader classLoader, URI uri ) {
this.name = name;
this.width = width;
Expand Down

0 comments on commit 97bed85

Please sign in to comment.