diff --git a/actions/publishToPublication.ts b/actions/publishToPublication.ts index 827bae6b..ebec9212 100644 --- a/actions/publishToPublication.ts +++ b/actions/publishToPublication.ts @@ -484,10 +484,10 @@ async function processBlocksToPages( let canvasBlockRecord: PubLeafletPagesCanvas.Block = { $type: "pub.leaflet.pages.canvas#block", block: content, - x: position.x, - y: position.y, - width, - ...(rotation !== undefined && { rotation }), + x: Math.floor(position.x), + y: Math.floor(position.y), + width: Math.floor(width), + ...(rotation !== undefined && { rotation: Math.floor(rotation) }), }; return canvasBlockRecord; diff --git a/lexicons/api/lexicons.ts b/lexicons/api/lexicons.ts index e14c622d..4de4c82b 100644 --- a/lexicons/api/lexicons.ts +++ b/lexicons/api/lexicons.ts @@ -1508,6 +1508,7 @@ export const schemaDict = { }, rotation: { type: 'integer', + description: 'The rotation of the block in degrees', }, }, }, diff --git a/lexicons/api/types/pub/leaflet/pages/canvas.ts b/lexicons/api/types/pub/leaflet/pages/canvas.ts index da5a3f21..3263d977 100644 --- a/lexicons/api/types/pub/leaflet/pages/canvas.ts +++ b/lexicons/api/types/pub/leaflet/pages/canvas.ts @@ -62,6 +62,7 @@ export interface Block { y: number width: number height?: number + /** The rotation of the block in degrees */ rotation?: number } diff --git a/lexicons/pub/leaflet/pages/canvas.json b/lexicons/pub/leaflet/pages/canvas.json index 39cf031c..dd1e7785 100644 --- a/lexicons/pub/leaflet/pages/canvas.json +++ b/lexicons/pub/leaflet/pages/canvas.json @@ -59,7 +59,8 @@ "type": "integer" }, "rotation": { - "type": "integer" + "type": "integer", + "description": "The rotation of the block in degrees" } } }, diff --git a/lexicons/src/pages/Canvas.ts b/lexicons/src/pages/Canvas.ts index 5b64fd57..68631c41 100644 --- a/lexicons/src/pages/Canvas.ts +++ b/lexicons/src/pages/Canvas.ts @@ -22,7 +22,10 @@ export const PubLeafletPagesCanvasDocument: LexiconDoc = { y: { type: "integer" }, width: { type: "integer" }, height: { type: "integer" }, - rotation: { type: "integer" }, + rotation: { + type: "integer", + description: "The rotation of the block in degrees", + }, }, }, textAlignLeft: { type: "token" },