Skip to content

Conversation

@kLabz
Copy link
Contributor

@kLabz kLabz commented Nov 24, 2025

The issue can be easily reproduced with this sample:

import h2d.Tile;
import h2d.Bitmap;
import h2d.Flow;

class Main extends hxd.App {
	static public function main() {
		new Main();
	}

	override function init() {
		var flow = new Flow(s2d);
		flow.maxWidth = 200;
		flow.multiline = true;
		flow.debug = true;

		new Bitmap(Tile.fromColor(0xFF00FF, 200, 10), flow);
		new Bitmap(Tile.fromColor(0x00FFFF, 20, 40), flow);
		new Bitmap(Tile.fromColor(0xFFFF00, 10, 20), flow);

		var flow = new Flow(s2d);
		flow.maxWidth = 200;
		flow.multiline = true;
		flow.verticalAlign = Top;
		flow.x = 250;
		flow.debug = true;

		new Bitmap(Tile.fromColor(0x00FFFF, 200, 10), flow);
		new Bitmap(Tile.fromColor(0x00FFFF, 20, 40), flow);
		new Bitmap(Tile.fromColor(0xFFFF00, 10, 20), flow);
	}
}

Resetting maxLineHeight to 0 before positioning nodes makes sure previously calculated maxLineHeight isn't being used for first line when it should not.

Current heaps:
2025-11-24-17:06-39-969032179

With this patch:
2025-11-24-17:06-54-352489809

Tested with shiroTools 73faca1146

@ncannasse
Copy link
Member

Shouldn't it also be done for columns in other align ?

@kLabz
Copy link
Contributor Author

kLabz commented Nov 24, 2025

Probably indeed, will check that
Edit: yep, exact same issue with vertical layout, and exact same fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants