@tldraw/primitives
Advanced tools
Comparing version 2.0.0-canary.b89612bdb750 to 2.0.0-canary.b96d207f5fea
@@ -0,1 +1,63 @@ | ||
# v2.0.0-alpha.13 (Wed Jun 28 2023) | ||
### Release Notes | ||
#### [refactor] snapping ([#1589](https://github.com/tldraw/tldraw/pull/1589)) | ||
- [editor] fix bug in snapping | ||
#### Fix arrows with weird bends crashing ([#1540](https://github.com/tldraw/tldraw/pull/1540)) | ||
- Fixed a rare crash that could happen when you try to curve an arrow with zero distance. | ||
#### [2/3] renderer changes to support "sandwich mode" highlighting ([#1418](https://github.com/tldraw/tldraw/pull/1418)) | ||
[not yet!] | ||
#### Measure individual words instead of just line breaks for text exports ([#1397](https://github.com/tldraw/tldraw/pull/1397)) | ||
- Add a brief release note for your PR here. | ||
#### avoid lazy race conditions ([#1364](https://github.com/tldraw/tldraw/pull/1364)) | ||
[internal only] | ||
--- | ||
#### 🚀 Enhancement | ||
- [2/3] renderer changes to support "sandwich mode" highlighting [#1418](https://github.com/tldraw/tldraw/pull/1418) ([@SomeHats](https://github.com/SomeHats)) | ||
#### 🐛 Bug Fix | ||
- [refactor] snapping [#1589](https://github.com/tldraw/tldraw/pull/1589) ([@steveruizok](https://github.com/steveruizok)) | ||
- Fix arrows with weird bends crashing [#1540](https://github.com/tldraw/tldraw/pull/1540) ([@TodePond](https://github.com/TodePond)) | ||
- ensure that fixed points stay fixed [#1523](https://github.com/tldraw/tldraw/pull/1523) ([@steveruizok](https://github.com/steveruizok)) | ||
- Measure individual words instead of just line breaks for text exports [#1397](https://github.com/tldraw/tldraw/pull/1397) ([@SomeHats](https://github.com/SomeHats)) | ||
- readmes [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@steveruizok](https://github.com/steveruizok)) | ||
- [chore] update lazyrepo [#1211](https://github.com/tldraw/tldraw/pull/1211) ([@ds300](https://github.com/ds300)) | ||
- Use `strokePathData` for `<ShapeFill/>` path to avoid bugs in the inner path algo [#1207](https://github.com/tldraw/tldraw/pull/1207) ([@orangemug](https://github.com/orangemug) [@steveruizok](https://github.com/steveruizok)) | ||
- [lite] upgrade lazyrepo [#1198](https://github.com/tldraw/tldraw/pull/1198) ([@ds300](https://github.com/ds300)) | ||
- transfer-out: transfer out [#1195](https://github.com/tldraw/tldraw/pull/1195) ([@SomeHats](https://github.com/SomeHats)) | ||
#### ⚠️ Pushed to `main` | ||
- update lazyrepo ([@ds300](https://github.com/ds300)) | ||
#### 🏠 Internal | ||
- replace console.log with nicelog [#1496](https://github.com/tldraw/tldraw/pull/1496) ([@steveruizok](https://github.com/steveruizok)) | ||
- [chore] remove benchmark [#1489](https://github.com/tldraw/tldraw/pull/1489) ([@steveruizok](https://github.com/steveruizok)) | ||
- avoid lazy race conditions [#1364](https://github.com/tldraw/tldraw/pull/1364) ([@SomeHats](https://github.com/SomeHats)) | ||
#### Authors: 5 | ||
- alex ([@SomeHats](https://github.com/SomeHats)) | ||
- David Sheldrick ([@ds300](https://github.com/ds300)) | ||
- Lu Wilson ([@TodePond](https://github.com/TodePond)) | ||
- Orange Mug ([@orangemug](https://github.com/orangemug)) | ||
- Steve Ruiz ([@steveruizok](https://github.com/steveruizok)) | ||
--- | ||
# v2.0.0-alpha.12 (Mon Apr 03 2023) | ||
@@ -2,0 +64,0 @@ |
@@ -586,2 +586,8 @@ import { Box2dModel } from '@tldraw/tlschema'; | ||
/** | ||
* Check if a float is safe to use. ie: Not too big or small. | ||
* @public | ||
*/ | ||
export declare const isSafeFloat: (n: number) => boolean; | ||
/** @public */ | ||
@@ -588,0 +594,0 @@ export declare function isSelectionCorner(selection: string): selection is SelectionCorner; |
@@ -74,2 +74,3 @@ "use strict"; | ||
isAngleBetween: () => import_utils.isAngleBetween, | ||
isSafeFloat: () => import_utils.isSafeFloat, | ||
isSelectionCorner: () => import_Box2d.isSelectionCorner, | ||
@@ -115,3 +116,2 @@ lerpAngles: () => import_utils.lerpAngles, | ||
var import_setStrokePointRadii = require("./lib/freehand/setStrokePointRadii"); | ||
var import_types = require("./lib/freehand/types"); | ||
var import_intersect = require("./lib/intersect"); | ||
@@ -118,0 +118,0 @@ var import_polygon_helpers = require("./lib/polygon-helpers"); |
@@ -44,2 +44,6 @@ "use strict"; | ||
const { a, b, c, d } = this.values; | ||
if (t <= 0) | ||
return import_Vec2d.Vec2d.From(a); | ||
if (t >= 1) | ||
return import_Vec2d.Vec2d.From(d); | ||
return new import_Vec2d.Vec2d( | ||
@@ -46,0 +50,0 @@ (1 - t) * (1 - t) * (1 - t) * a.x + 3 * ((1 - t) * (1 - t)) * t * b.x + 3 * (1 - t) * (t * t) * c.x + t * t * t * d.x, |
@@ -56,2 +56,6 @@ "use strict"; | ||
const { a, b } = this.values; | ||
if (t <= 0) | ||
return import_Vec2d.Vec2d.From(a); | ||
if (t >= 1) | ||
return import_Vec2d.Vec2d.From(b); | ||
return import_Vec2d.Vec2d.Lrp(a, b, t); | ||
@@ -58,0 +62,0 @@ } |
@@ -47,2 +47,3 @@ "use strict"; | ||
isAngleBetween: () => isAngleBetween, | ||
isSafeFloat: () => isSafeFloat, | ||
lerpAngles: () => lerpAngles, | ||
@@ -398,2 +399,5 @@ longAngleDist: () => longAngleDist, | ||
} | ||
const isSafeFloat = (n) => { | ||
return Math.abs(n) < Number.MAX_SAFE_INTEGER; | ||
}; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@tldraw/primitives", | ||
"description": "A tiny little drawing app (primitives).", | ||
"version": "2.0.0-canary.b89612bdb750", | ||
"version": "2.0.0-canary.b96d207f5fea", | ||
"packageManager": "yarn@3.5.0", | ||
@@ -45,3 +45,3 @@ "author": { | ||
"dependencies": { | ||
"@tldraw/tlschema": "2.0.0-canary.b89612bdb750" | ||
"@tldraw/tlschema": "2.0.0-canary.b96d207f5fea" | ||
}, | ||
@@ -48,0 +48,0 @@ "jest": { |
@@ -76,2 +76,3 @@ export { | ||
isAngleBetween, | ||
isSafeFloat, | ||
lerpAngles, | ||
@@ -78,0 +79,0 @@ longAngleDist, |
@@ -34,5 +34,5 @@ import { CubicSegment2d } from './CubicSegment2d' | ||
it(`has the expected normals`, () => { | ||
expect(b.getNormal(0)).toMatchObject({ x: -1, y: -0 }) | ||
expect(b.getNormal(0)).toMatchObject({ x: -1, y: 0 }) | ||
expect(b.getNormal(0.5)).toMatchObject({ x: -0, y: 1 }) | ||
expect(b.getNormal(1)).toMatchObject({ x: 1, y: -0 }) | ||
expect(b.getNormal(1)).toMatchObject({ x: 1, y: 0 }) | ||
}) | ||
@@ -39,0 +39,0 @@ |
@@ -37,2 +37,5 @@ import { BaseSegment2d } from './BaseSegment2d' | ||
if (t <= 0) return Vec2d.From(a) | ||
if (t >= 1) return Vec2d.From(d) | ||
return new Vec2d( | ||
@@ -39,0 +42,0 @@ (1 - t) * (1 - t) * (1 - t) * a.x + |
@@ -50,2 +50,5 @@ import { BaseSegment2d } from './BaseSegment2d' | ||
if (t <= 0) return Vec2d.From(a) | ||
if (t >= 1) return Vec2d.From(b) | ||
return Vec2d.Lrp(a, b, t) | ||
@@ -52,0 +55,0 @@ } |
@@ -677,1 +677,9 @@ import { Box2d } from './Box2d' | ||
} | ||
/** | ||
* Check if a float is safe to use. ie: Not too big or small. | ||
* @public | ||
*/ | ||
export const isSafeFloat = (n: number) => { | ||
return Math.abs(n) < Number.MAX_SAFE_INTEGER | ||
} |
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
726873
11078
0
+ Added@tldraw/state@2.0.0-canary.b96d207f5fea(transitive)
+ Added@tldraw/store@2.0.0-canary.b96d207f5fea(transitive)
+ Added@tldraw/tlschema@2.0.0-canary.b96d207f5fea(transitive)
+ Added@tldraw/utils@2.0.0-canary.b96d207f5fea(transitive)
+ Added@tldraw/validate@2.0.0-canary.b96d207f5fea(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedreact@18.3.1(transitive)
- Removed@tldraw/store@2.0.0-canary.b89612bdb750(transitive)
- Removed@tldraw/tlschema@2.0.0-canary.b89612bdb750(transitive)
- Removed@tldraw/utils@2.0.0-canary.b89612bdb750(transitive)
- Removed@tldraw/validate@2.0.0-canary.b89612bdb750(transitive)
- Removedsignia@0.1.5(transitive)