Permalink
Browse files

Merge pull request #1 from deafbybeheading/master

Fixing a couple of edge conditions
  • Loading branch information...
2 parents 369c89a + a39136c commit 1166bcf5516bf2ee12be0ca37fe206ae07b825d2 @ThomasBurleson ThomasBurleson committed Aug 2, 2012
View
@@ -21,6 +21,7 @@
<property name="version" value="alpha"/>
<property name="flare.src" value="${basedir}/flare/src"/>
+ <property name="flare.flex.src" value="${basedir}/flare/src-flex-integration"/>
<property name="flare.lib" value="${basedir}/flare/lib"/>
<property name="apps.src" value="${basedir}/flare.apps/src"/>
<property name="demos.src" value="${basedir}/flare.demos/src"/>
@@ -48,6 +49,7 @@
<echo message=""/>
<echo message=" all --> builds flare and demos in ./build}"/>
<echo message=" flare --> builds the flare libraries in ./build"/>
+ <echo message=" flare-flex --> builds the flare Flex integration libraries in ./build"/>
<echo message=" apps --> builds the apps project in ./build"/>
<echo message=" demos --> builds the demos app in ./build"/>
<echo message=" tests --> builds the tests app in ./build"/>
@@ -99,6 +101,32 @@
</compc>
</target>
+ <target name="flare-flex" depends="flare">
+ <!-- Shameless copy from above; ant doesn't make this kind of workflow easy -->
+ <!-- First we have to collect all the AS files -->
+ <path id="flare.flex.files">
+ <fileset dir="${flare.flex.src}">
+ <include name="**/**"/>
+ </fileset>
+ </path>
+ <pathconvert
+ property="flare.flex.classes"
+ pathsep=" "
+ dirsep="."
+ refid="flare.flex.files">
+ <map from="${flare.flex.src}/" to=""/>
+ <mapper>
+ <chainedmapper><globmapper from="*.as" to="*"/></chainedmapper>
+ </mapper>
+ </pathconvert>
+
+ <!-- Now we build the .swc -->
+ <compc output="${build.dir}/flare-flex.swc" include-classes="${flare.flex.classes}">
+ <external-library-path file="${build.dir}/flare.swc" append="true"/>
+ <source-path path-element="${flare.flex.src}/"/>
+ </compc>
+ </target>
+
<!-- =================================================================== -->
<!-- Compile apps -->
@@ -226,7 +226,7 @@ package flare.vis.data
/** @inheritDoc */
public override function render() : void
{
- if (_renderer != null) {
+ if (_renderer != null && !isNaN(size)) {
_renderer.render(this);
} else {
this.graphics.clear();
@@ -219,6 +219,9 @@ package flare.vis.operator.layout
_b.right = _b.bottom = Number.MIN_VALUE;
_order = 0;
+ // handle edge case
+ if (N==0) return 0;
+
// create first node
a = nodes[0]; a.x = -a.r; a.y = 0; updateBounds(a,_b);
if (N==1) return center(nodes, _b);

0 comments on commit 1166bcf

Please sign in to comment.