---
name: "CanvasContext.scale"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.21.8" }
title: "scale"
---

## CanvasContext.scale

> [VERSION] Base Library >= 2.21.8

### Description

After this call, the x and y coordinates of subsequently created paths will be scaled

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `scaleWidth` | `number` | Yes | Scale factor on the x axis |
| `scaleHeight` | `number` | Yes | Scale factor on the y axis |

### Return Value

None


### Examples

#### Scale

```ts
const ctx = ty.createCanvasContext('myCanvas');
ctx.scale(2, 2);
ctx.fillRect(10, 10, 25, 15);
ctx.draw();
```
