Fix HTML5 resizable window
This commit is contained in:
@@ -192,6 +192,12 @@ class HTML5Window {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((Reflect.hasField (attributes, "resizable") && attributes.resizable) || (!Reflect.hasField (attributes, "width") && setWidth == 0 && setHeight == 0)) {
|
||||||
|
|
||||||
|
parent.__resizable = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
updateSize ();
|
updateSize ();
|
||||||
|
|
||||||
if (element != null) {
|
if (element != null) {
|
||||||
@@ -1316,8 +1322,13 @@ class HTML5Window {
|
|||||||
|
|
||||||
private function updateSize ():Void {
|
private function updateSize ():Void {
|
||||||
|
|
||||||
|
|
||||||
|
trace ("1");
|
||||||
|
|
||||||
if (!parent.__resizable) return;
|
if (!parent.__resizable) return;
|
||||||
|
|
||||||
|
trace ("2");
|
||||||
|
|
||||||
var elementWidth, elementHeight;
|
var elementWidth, elementHeight;
|
||||||
|
|
||||||
if (parent.element != null) {
|
if (parent.element != null) {
|
||||||
@@ -1333,18 +1344,18 @@ class HTML5Window {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (elementWidth != cacheElementWidth || elementHeight != cacheElementHeight) {
|
if (elementWidth != cacheElementWidth || elementHeight != cacheElementHeight) {
|
||||||
|
trace ("3");
|
||||||
cacheElementWidth = elementWidth;
|
cacheElementWidth = elementWidth;
|
||||||
cacheElementHeight = elementHeight;
|
cacheElementHeight = elementHeight;
|
||||||
|
|
||||||
var stretch = resizeElement || (setWidth == 0 && setHeight == 0);
|
var stretch = resizeElement || (setWidth == 0 && setHeight == 0);
|
||||||
|
|
||||||
if (parent.element != null && (div == null || (div != null && stretch))) {
|
if (parent.element != null && (div == null || (div != null && stretch))) {
|
||||||
|
trace ("4");
|
||||||
if (stretch) {
|
if (stretch) {
|
||||||
|
trace ("5");
|
||||||
if (parent.__width != elementWidth || parent.__height != elementHeight) {
|
if (parent.__width != elementWidth || parent.__height != elementHeight) {
|
||||||
|
trace ("6");
|
||||||
parent.__width = elementWidth;
|
parent.__width = elementWidth;
|
||||||
parent.__height = elementHeight;
|
parent.__height = elementHeight;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user