Form hi = new Form("Viewer", new BorderLayout());
FontImage img = FontImage.createMaterial(FontImage.MATERIAL_IMAGE, UIManager.getInstance().getComponentStyle("Label"), 20f);
ImageViewer viewer = new ImageViewer(img) {
int cilckCount = 0;
@Override
public void pointerReleased(int x, int y) {
cilckCount ++;
new UITimer(() -> cilckCount = 0).schedule(500, false, hi);
if (cilckCount > 1) {
cilckCount = 0;
if (this.getZoom() > 1) {
this.setZoom(1);
} else {
this.setZoom(2);
}
}
}
};
hi.add(BorderLayout.CENTER, viewer);
hi.show();
Just double tap on the image to zoom and then pan it around. You will see that you can pan outside the boundaries, which should not happen. If you style the form background color, the failure is more evident.If you revert the changes that Shai points out above, it works as it should.
--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/caf919f8-d5ea-47e8-8a96-a975762b483co%40googlegroups.com.
Great, thank you.
--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/ebdfeae1-107f-4e23-abcb-4384653cd5b8o%40googlegroups.com.