Drawing Context Manager
Handles canvas context state management using functional composition
Methods
(static) withContext(drawFn) → {function}
Executes a drawing operation with saved context state
Parameters:
Name | Type | Description |
---|---|---|
drawFn |
function | Drawing function to execute |
Returns:
- Type
- function
(static) withRotation(angle, x, y) → {function}
Applies a rotation transformation around a point
Parameters:
Name | Type | Description |
---|---|---|
angle |
number | Rotation angle in radians |
x |
number | Center X coordinate |
y |
number | Center Y coordinate |
Returns:
- Type
- function
(static) withTranslation(x, y) → {function}
Applies a translation transformation
Parameters:
Name | Type | Description |
---|---|---|
x |
number | X translation |
y |
number | Y translation |
Returns:
- Type
- function