This commit is contained in:
2014-01-07 16:21:07 +04:00
parent 29bd374fc2
commit c35446a031
4 changed files with 18 additions and 6 deletions

View File

@@ -28,8 +28,8 @@ class HorizontalLayout extends DefaultLayout {
} }
if (group.contentSize) { if (group.contentSize) {
group.width = fixedSize; group.width = fixedSize + group.leftPadding + group.rightPadding;
group.height = maxHeight; group.height = maxHeight + group.topPadding + group.bottomPadding;
} }
leftSize -= fixedSize; leftSize -= fixedSize;

View File

@@ -27,8 +27,8 @@ class VerticalLayout extends DefaultLayout {
} }
if (group.contentSize) { if (group.contentSize) {
group.width = maxWidth; group.width = maxWidth + group.leftPadding + group.rightPadding;
group.height = fixedSize; group.height = fixedSize + group.topPadding + group.bottomPadding;
} }
leftSize -= fixedSize; leftSize -= fixedSize;

View File

@@ -65,9 +65,21 @@ class BaseURLLoader<T> extends BaseLoader<T> {
override private function onError(e:Event):Void { override private function onError(e:Event):Void {
var c:ICallback<T> = callback; var c:ICallback<T> = callback;
var error:String = loader.data ? Std.string(loader.data) : null; var error:String = extrudeError(loader.data);
dispose(); dispose();
c.callFail(error != null ? error : e); c.callFail(error != null ? error : e);
} }
private function extrudeError(data:Dynamic):String {
return if (data == null) null else {
var s:String = Std.string(data);
var r:EReg = ~/<h1>(.*?)<\/h1>/;
if (r.match(s)) {
r.matched(1);
} else {
s;
}
}
}
} }

View File

@@ -5,7 +5,7 @@ import haxework.core.Tuple;
import haxe.ds.StringMap; import haxe.ds.StringMap;
import flash.display.BitmapData; import flash.display.BitmapData;
typedef F = Tuple2<Dynamic, String> private typedef F = Tuple2<Dynamic, String>
class ResMap<T> extends StringMap<T> { class ResMap<T> extends StringMap<T> {