The document describes the creation and use of a ScaledShape in a SwiftUI context, allowing for scaling shapes while retaining their properties. It outlines two main use cases for ScaledShape and provides a simple code example demonstrating its implementation. Additionally, it includes a visual representation of a scaled rectangle within an orange border.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
6 views1 page
Scaled Metric
The document describes the creation and use of a ScaledShape in a SwiftUI context, allowing for scaling shapes while retaining their properties. It outlines two main use cases for ScaledShape and provides a simple code example demonstrating its implementation. Additionally, it includes a visual representation of a scaled rectangle within an orange border.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1
Creates the scaled metric with an unscaled value and a text style to
scale relative to.
Creates the scaled metric with an unscaled value using the default scaling. The value scaled based on the current environment. A shape with a scale transform applied to it.
A scaled shape has two use cases:
1. Used directly via its initializer, ``ScaledShape/init(shape:scale:anchor:)``. 2. As the return value of the ``Shape/scale(x:y:anchor:)`` and ``Shape/scale(_:anchor:)``.
Having a scaled shape is helpful because it allows you to scale a shape
and then continue to use its shape properties, instead of turning into ``View``.
A simple example of constructing a ``ScaledShape``:

JavaScript Fundamentals: JavaScript Syntax, What JavaScript is Use for in Website Development, JavaScript Variable, Strings, Popup Boxes, JavaScript Objects, Function, and Event Handlers