---
title: "scaleBy(x:y:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/graphicscontext/scaleby(x:y:)"
---

# scaleBy(x:y:)

Scales subsequent drawing operations by an amount in each dimension.

## Declaration

```swift
mutating func scaleBy(x: CGFloat, y: CGFloat)
```

## Parameters

- `x`: The amount to scale in the horizontal direction.
- `y`: The amount to scale in the vertical direction.

## Discussion

Discussion Calling this method is equivalent to updating the context’s transform directly using the given scale factors: transform = transform.scaledBy(x: x, y: y)

## See Also

### Applying transforms

- [rotate(by:)](swiftui/graphicscontext/rotate(by:).md)
- [translateBy(x:y:)](swiftui/graphicscontext/translateby(x:y:).md)
- [concatenate(_:)](swiftui/graphicscontext/concatenate(_:).md)
- [transform](swiftui/graphicscontext/transform.md)
