@tldraw/utils
Advanced tools
Comparing version 3.9.0-canary.6beea33123dd to 3.9.0-canary.6f51d9267136
@@ -161,5 +161,5 @@ "use strict"; | ||
"@tldraw/utils", | ||
"3.9.0-canary.6beea33123dd", | ||
"3.9.0-canary.6f51d9267136", | ||
"cjs" | ||
); | ||
//# sourceMappingURL=index.js.map |
@@ -170,3 +170,4 @@ "use strict"; | ||
if (physData.unit === 0 && physData.ppux === physData.ppuy) { | ||
const pixelRatio = Math.max(physData.ppux / 2834.5, 1); | ||
const pixelsPerMeter = 72 / 0.0254; | ||
const pixelRatio = Math.max(physData.ppux / pixelsPerMeter, 1); | ||
return { | ||
@@ -173,0 +174,0 @@ w: Math.round(image.naturalWidth / pixelRatio), |
{ | ||
"name": "@tldraw/utils", | ||
"description": "A tiny little drawing app (private utilities).", | ||
"version": "3.9.0-canary.6beea33123dd", | ||
"version": "3.9.0-canary.6f51d9267136", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "tldraw Inc.", |
@@ -23,2 +23,2 @@ ## @tldraw/utils | ||
Have questions, comments or feedback? [Join our discord](https://discord.gg/rhsyWMUJxd) or [start a discussion](https://github.com/tldraw/tldraw/discussions/new). For the latest news and release notes, visit [tldraw.dev](https://tldraw.dev). | ||
Have questions, comments or feedback? [Join our discord](https://discord.tldraw.com/?utm_source=github&utm_medium=social&utm_campaign=sociallink). For the latest news and release notes, visit [tldraw.dev](https://tldraw.dev). |
@@ -166,3 +166,8 @@ import { promiseWithResolve } from '../control' | ||
if (physData.unit === 0 && physData.ppux === physData.ppuy) { | ||
const pixelRatio = Math.max(physData.ppux / 2834.5, 1) | ||
// Calculate pixels per meter: | ||
// - 1 inch = 0.0254 meters | ||
// - 72 DPI is 72 dots per inch | ||
// - pixels per meter = 72 / 0.0254 | ||
const pixelsPerMeter = 72 / 0.0254 | ||
const pixelRatio = Math.max(physData.ppux / pixelsPerMeter, 1) | ||
return { | ||
@@ -169,0 +174,0 @@ w: Math.round(image.naturalWidth / pixelRatio), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
539854
8049