Fixed fullscreen image gallery not working, when containing an image

without width and/or height set
This commit is contained in:
Benjamin Barth committed 2015-09-01 12:44:29 +02:00
1 parent 2564459286
commit 0daa85b359
1 file changed
+2 -2
@@ -8,6 +8,7 @@ import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.ImageElement;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.ResizeComposite;
@@ -43,8 +44,7 @@ public class SailingGalleryPlayer extends ResizeComposite {
private ImageElement createThumbImgElement(SailingImageDTO i ) {
ImageElement img = Document.get().createImageElement();
img.setAttribute("src", i.getSourceRef());
img.setHeight(100);
img.setWidth(i.getWidthInPx() * 100 / i.getHeightInPx());
img.getStyle().setHeight(103, Unit.PX);
return img;
}