fix(app): annotations tab split, editor-wide undo keys, keyboard point fits, typed radius message
This commit is contained in:
1 parent
447d0a4272
commit
3f15762d95
25 files changed
+1398
-653
No files matched your search
@@ -58,15 +58,6 @@ export function defaultRadius(frame: Frame): number {
|
||||
return floor2(Math.min(wanted, Math.min(frame.w, frame.h) / 2))
|
||||
}
|
||||
|
||||
/** Where a keyboard-created point sits: the centre of F, which fits by construction. */
|
||||
export function centreCircle(frame: Frame): CircleShape {
|
||||
return {
|
||||
cx: round2(frame.x + frame.w / 2),
|
||||
cy: round2(frame.y + frame.h / 2),
|
||||
r: defaultRadius(frame),
|
||||
}
|
||||
}
|
||||
|
||||
function distanceToEdge(frame: Frame, at: XY): number {
|
||||
return Math.min(
|
||||
at.x - frame.x,
|
||||
@@ -143,5 +134,16 @@ export function centreTriangle(frame: Frame): [number, number][] {
|
||||
return corners.map(([x, y]) => [round2(x), round2(y)])
|
||||
}
|
||||
|
||||
/**
|
||||
* Where a keyboard-created point sits: the centre of F with r0. Clamped as candidate C is,
|
||||
* so it fits even with an origin off the 0.01 grid and r0 = min(w, h) / 2.
|
||||
*/
|
||||
export function centreCircle(frame: Frame): CircleShape {
|
||||
return correctedCircle(frame, {
|
||||
x: frame.x + frame.w / 2,
|
||||
y: frame.y + frame.h / 2,
|
||||
})
|
||||
}
|
||||
|
||||
export const sameCircle = (a: CircleShape, b: CircleShape): boolean =>
|
||||
a.cx === b.cx && a.cy === b.cy && a.r === b.r
|
||||
Reference in new issue
Block a user