mohammadGh / opal

Automatically exported from code.google.com/p/opal
1 stars 0 forks source link

2 ImageSelector bugs, 1 improvement. #46

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Just found your code library and started to use in my supersync app. Fantastic!

Some quick changes...

#1. 
ImageSelector.java
change:
        private void scrollAndAnimateBy(final int increment) {
        if (this.index == 0 && increment < 0 || this.index == this.items.size() - 1 && increment > 0) {
            return;
        }

to
    private void scrollAndAnimateBy(final int increment) {
        if (increment == 0 || this.index == 0 && increment < 0 || this.index == this.items.size() - 1 && increment > 0) {
            return;
        }

If increment is 0 (and can be) step will be 0, and the animation will run 
forever.

#2 SWTGraphicUtil.createReflectedResizedImage
Resource leak. This one is serious.

Change:
        imgData.alphaData = alphaData;
        return new Image(source.getDevice(), imgData);

        imgData.alphaData = alphaData;
        newImage.dispose(); // BHL Added 2015/04/20 to remove resource leak.
        return new Image(source.getDevice(), imgData);

#3 ISItem.java (feature request) 
Add constructor to allow any image.
    public ISItem(final String title, final Image img)
    {
        setImage(img);
        setText(title);
    }

Original issue reported on code.google.com by bhLowe on 20 Apr 2015 at 9:25

GoogleCodeExporter commented 8 years ago
Issue management is moved to Github

Original comment by laurent....@gmail.com on 1 Jul 2015 at 9:06