Commit cf16f1dc authored by josmas's avatar josmas

do not resize the canvas icon if a background image is not being used

Change-Id: If601bafd70beb7e0b5bf995727055f3685a8a03d
parent 5cc3cd57
......@@ -8,6 +8,7 @@ package com.google.appinventor.client.editor.simple.components;
import com.google.appinventor.client.editor.simple.SimpleEditor;
import com.google.appinventor.client.editor.simple.palette.SimplePaletteItem;
import com.google.appinventor.client.widgets.dnd.DragSource;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.AbsolutePanel;
import java.util.Comparator;
......@@ -83,12 +84,15 @@ public final class MockCanvas extends MockContainer {
// text was not recognized as an asset.
((MockCanvasLayout) layout).setBackgroundImageUrl("");
url = "images/canvas.png";
// We set the background image of the canvasWidget so it displays the image. We do it inside
// the if because we need to override the background-size property only for this case
MockComponentsUtil.setWidgetBackgroundImage(canvasWidget, url);
DOM.setStyleAttribute(canvasWidget.getElement(), "backgroundSize", "");
} else {
((MockCanvasLayout) layout).setBackgroundImageUrl(url);
// We set the background image of the canvasWidget so it displays the image.
MockComponentsUtil.setWidgetBackgroundImage(canvasWidget, url);
}
// We set the background image of the canvasWidget so it displays the image.
MockComponentsUtil.setWidgetBackgroundImage(canvasWidget, url);
}
private static class MockSpriteWithCoordinates {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment