kas-gui / kas

Another GUI toolkit
Apache License 2.0
892 stars 27 forks source link

AutoLayout → LayoutVisitor #434

Closed dhardy closed 5 months ago

dhardy commented 5 months ago

Replace trait AutoLayout with LayoutVisitor using RPITIT to move the temporary layout visitor into a method.

Code should be more inlinable for better optimisation and has reduced size in optimised builds, but debug builds are larger. Size of gallery (bytes):

Commit Debug Stripped Release Stripped
16bd205612c601aa7c85c8791acac7d2b5411688 248853056 37325408 23188160 14148312
c85179905830e57f39100816057ce920d516a7a2 248793400 37321136 23172256 14143248
c792102bcc313174385487134745dfff15893e9e 248971880 37350112 23158136 14135344
f40e17d63ecc130d384cf2873db783f928a38d1a 248971224 37350112 23158088 14135344
1706ddc689162fe3e1fa79ba08e58891a526bb96 249231608 37392720 23117136 14085992

Also fix docs.rs builds for kas-dylib, kas-resvg. See https://github.com/rust-lang/docs.rs/issues/2359.