@tldraw/utils
Advanced tools
Comparing version 3.9.0-canary.62899bc86ee5 to 3.9.0-canary.62dce36fb020
@@ -161,5 +161,5 @@ "use strict"; | ||
"@tldraw/utils", | ||
"3.9.0-canary.62899bc86ee5", | ||
"3.9.0-canary.62dce36fb020", | ||
"cjs" | ||
); | ||
//# sourceMappingURL=index.js.map |
@@ -31,2 +31,5 @@ "use strict"; | ||
running = false; | ||
isEmpty() { | ||
return this.queue.length === 0 && !this.running; | ||
} | ||
async run() { | ||
@@ -33,0 +36,0 @@ if (this.running) return; |
@@ -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.62899bc86ee5", | ||
"version": "3.9.0-canary.62dce36fb020", | ||
"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). |
@@ -10,2 +10,6 @@ import { sleep } from './control' | ||
isEmpty() { | ||
return this.queue.length === 0 && !this.running | ||
} | ||
private async run() { | ||
@@ -12,0 +16,0 @@ if (this.running) return |
@@ -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
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
40348
8049