0.14 - Aspect Ratio Elements, Better Clipping
New Features
Non-image aspect ratio scaling elements, image stretching
Previously, only image elements supported aspect ratio scaling. The new .aspectRatio element configuration option allows you to specify a fixed width / height aspect ratio for any element. This also allows you to create image elements with no specified aspect ratio, allowing for stretched / distorted images with a different aspect ratio to their source dimensions. Different images rendering modes similar to the CSS concepts of contain and cover, as well as 9-slice support are scheduled for 0.15.
// Old
CLAY({
.image = { .imageData = &myImage, .sourceDimensions = { 1024, 768 } }
});
// New
CLAY({
.aspectRatio = 1024.0 / 768.0,
.image = { .imageData = &myImage }
});
Improved .clip configuration option replaces .scroll
As part of our longer term effort to separate interaction handling from the core layout library, the configuration option has been replace with . This new configuration options allows: