From b7ce726cad09883972f7630ccb3ff164d7d9b07f Mon Sep 17 00:00:00 2001 From: UnrelatedString <33167175+UnrelatedString@users.noreply.github.com> Date: Tue, 18 Mar 2025 12:42:44 -0400 Subject: [PATCH 1/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 522e284..d96d894 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based ## [Unreleased] Breaking changes: +- Changed types of width and height from Number to Int New features: - Added `imageSmoothingEnabled` to toggle the image smoothing of a `Context2D`. From 1b23f9a77a333ccac363bf95f09ac5407870957a Mon Sep 17 00:00:00 2001 From: UnrelatedString <33167175+UnrelatedString@users.noreply.github.com> Date: Tue, 18 Mar 2025 12:46:24 -0400 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d96d894..3db6ddd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ Notable changes to this project are documented in this file. The format is based ## [Unreleased] Breaking changes: -- Changed types of width and height from Number to Int +- Changed types of width and height from Number to Int. The API guarantees that these values are integers as is, and even silently rounds non-integers if given. New features: - Added `imageSmoothingEnabled` to toggle the image smoothing of a `Context2D`. From a3786d274348774a79e162fd0f208df70e10cb3c Mon Sep 17 00:00:00 2001 From: UnrelatedString <33167175+UnrelatedString@users.noreply.github.com> Date: Tue, 18 Mar 2025 12:47:50 -0400 Subject: [PATCH 3/3] Update Canvas.purs --- src/Graphics/Canvas.purs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Graphics/Canvas.purs b/src/Graphics/Canvas.purs index 8e55bc4..36bed07 100644 --- a/src/Graphics/Canvas.purs +++ b/src/Graphics/Canvas.purs @@ -172,19 +172,19 @@ getCanvasElementById elId = runFn3 getCanvasElementByIdImpl elId Just Nothing foreign import getContext2D :: CanvasElement -> Effect Context2D -- | Get the canvas width in pixels. -foreign import getCanvasWidth :: CanvasElement -> Effect Number +foreign import getCanvasWidth :: CanvasElement -> Effect Int -- | Get the canvas height in pixels. -foreign import getCanvasHeight :: CanvasElement -> Effect Number +foreign import getCanvasHeight :: CanvasElement -> Effect Int -- | Set the canvas width in pixels. -foreign import setCanvasWidth :: CanvasElement -> Number -> Effect Unit +foreign import setCanvasWidth :: CanvasElement -> Int -> Effect Unit -- | Set the canvas height in pixels. -foreign import setCanvasHeight :: CanvasElement -> Number -> Effect Unit +foreign import setCanvasHeight :: CanvasElement -> Int -> Effect Unit -- | Canvas dimensions (width and height) in pixels. -type Dimensions = { width :: Number, height :: Number } +type Dimensions = { width :: Int, height :: Int } -- | Get the canvas dimensions in pixels. getCanvasDimensions :: CanvasElement -> Effect Dimensions