Tiny code change to Lemur GUI: Fill.Last in BoxLayout

Hi!

I’ve been using JME3 for quite a while now (and loving it). Great work guys!

I’ve just started using the Lemur GUI and I think I found a missing feature aspect: I couldn’t get Fill.Last to work in BoxLayout.
So, I edited the Lemur code to get it working for me (at least what I suspect Fill.Last should do), but I haven’t tested beyond that.

It’s a tiny change, but I could test it further and/or commit it if that would be useful.

Sorry if this is a trivial question - not posted here before.

[java]
Vector3f p = pos.clone();
float axisSizeRunningTotal = 0.f;
for( int i = 0; i < children.size(); i++ ) {
Node n = children.get(i);
Vector3f pref = preferredSizes.get(i).clone();

switch( fill ) {

case Last:
// resize the last child to fill the space
if( i == children.size()-1 ) {
axisSize = axisSizeTotal - axisSizeRunningTotal;
} else {
axisSize = axisPref;
}
break;
}

        axisSizeRunningTotal += axisSize;


[/java]

I’ll take a look at my next opportunity. I’ve actually considered removing box layout since SpringGridLayout does everything it does and more. I’m kind of on the fence, though.

Thanks for the post.

No problem - Thanks for the quick reply!

From a learning-curve point of view I have appreciated BoxLayout being there - it means there are fewer moving parts when I’m trying to figure out what I haven’t done right.

Also, I found that tiny addition easy to make because BoxLayout is nice and simple.

I can understand the maintenance hassle of an extra class though.