Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
as committed Oct 11, 2015
1 parent 3caccb1 commit 1d37edb
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 26 deletions.
Binary file modified bin/Falcon.swc
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ package com.hendrix.feathers.controls.core.sql.sqlSerialData
private var _TABLE_NAME: String;

// Contacts Table Columns names
private static const KEY_ID: String = "id";
private static const KEY_DATA: String = "data";
protected static const KEY_ID: String = "id";
protected static const KEY_DATA: String = "data";

private var _connection: SQLConnection = null;
protected var _connection: SQLConnection = null;

private var _dbName: String = null;
private var _dbPath: File = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ package com.hendrix.feathers.controls.core.sql.sqlSerialData
arr[ix].data = Serialize.stringToObject(arr[ix].data);
}


return arr;
}
}
Expand Down
22 changes: 10 additions & 12 deletions src/com/hendrix/feathers/controls/flex/FlexImage.as
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ package com.hendrix.feathers.controls.flex
*
* <ul>
* <li>set <code>scaleMode</code> to <code>SCALEMODE_STRECTH, SCALEMODE_LETTERBOX, SCALEMODE_ZOOM, SCALEMODE_NONE</code></li>
* <li>with <code>SCALEMODE_LETTERBOX</code> works even if one dimension is specified</li>
* <li>set <code>_forceDisposeConcreteTexture</code> to control disposal of concrete textures</li>
* <li>set <code>source</code> to MrGfxManager package paths ala "packA::map", or disk path "../assets/a.png"</li>
* <li>set <code>color</code> to tint the image</li>
* </ul>
* </ul>
*
* <p/>
* <b>TODO:</b>
* <li>add alignment tools with <code>horizontalAlign/verticalAlign</code>
*
* @author Tomer Shalev
*/
Expand Down Expand Up @@ -48,16 +53,6 @@ package com.hendrix.feathers.controls.flex

private var _color: int = -1;

/**
* <p>a Flex comp Image container</p>
* <ul>
* <li>set <code>scaleMode</code> to <code>SCALEMODE_STRECTH, SCALEMODE_LETTERBOX, SCALEMODE_ZOOM, SCALEMODE_NONE</code></li>
* <li>set <code>_forceDisposeConcreteTexture</code> to control disposal of concrete textures</li>
* <li>set <code>source</code> to MrGfxManager package paths ala "packA::map", or disk path "../assets/a.png"</li>
* </ul>
* </p>
* @author Tomer Shalev
*/
public function FlexImage()
{
super();
Expand Down Expand Up @@ -240,7 +235,7 @@ package com.hendrix.feathers.controls.flex
ar = Math.min(arW, arH);
if(ar == 0)
ar = Math.max(arW, arH);
imgW = _img.texture.width * ar;
imgW = _img.texture.width * ar;
imgH = _img.texture.height * ar;
break;
}
Expand Down Expand Up @@ -293,6 +288,9 @@ package com.hendrix.feathers.controls.flex
_img.width = imgW;
_img.height = imgH;

_img.x =(width - _img.width) * 0.5;
_img.y =(height - _img.height) * 0.5;

if(width == 0)
width = imgW;

Expand Down
2 changes: 1 addition & 1 deletion src/com/hendrix/feathers/controls/flex/HGroup.as
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ package com.hendrix.feathers.controls.flex
// if width was not set, then we give the width that the children occupy
if(width == 0) {
explicitWidth = NaN;
var c: Number = isNaN(percentHeight) ? 0 : percentWidth*relativeCalcWidthParent.width;
var c: Number = isNaN(percentWidth) ? 0 : percentWidth*relativeCalcWidthParent.width;
var a: Boolean = setSizeInternal(Math.max(posx, c), height, false);
}

Expand Down
25 changes: 16 additions & 9 deletions src/com/hendrix/feathers/controls/utils/serialize/Serialize.as
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,22 @@ package com.hendrix.feathers.controls.utils.serialize
return Base64.encodeByteArray(ba);
}

static public function objectToString(obj:Object):String
{
_byteArray.position = 0;
_byteArray.length = 0;
_byteArray.writeObject(obj);

return Base64.encodeByteArray(_byteArray);
}

static public function objectToString(obj:Object):String
{
return Base64.encodeByteArray(objectToByteArray(obj));
}

static public function objectToByteArray(obj:Object, $ba: ByteArray = null):ByteArray
{
var ba: ByteArray = $ba ? $ba : new ByteArray();

ba.position = 0;

ba.writeObject(obj);

return ba;
}

static public function stringToObject(data:String):Object
{
var ba: ByteArray = Base64.decodeToByteArray(data);
Expand Down

0 comments on commit 1d37edb

Please sign in to comment.