Handle für Y-Grösse des Puffers funktinoierte nicht korrekt.

This commit is contained in:
Michael Stangl
2026-04-27 12:12:08 +02:00
parent 36e2d81843
commit e70af5f548
2 changed files with 13 additions and 10 deletions
+5 -2
View File
@@ -62,11 +62,14 @@ export class PufferShapeUtil extends ShapeUtil<PufferShape> {
{ handle }: { handle: TLHandle }
): TLShapePartial<PufferShape> | void {
if (handle.id === 'top') {
const newH = Math.min(CFG.maxH, Math.max(CFG.minH, shape.props.h - handle.y))
// Bottom edge stays fixed; compute new height from mouse page position
const bottom = shape.y + shape.props.h
const mouseY = this.editor.inputs.currentPagePoint.y
const newH = Math.min(CFG.maxH, Math.max(CFG.minH, bottom - mouseY))
return {
id: shape.id,
type: 'puffer',
y: shape.y + (shape.props.h - newH),
y: bottom - newH,
props: { ...shape.props, h: newH },
}
}
+8 -8
View File
@@ -2,17 +2,17 @@
* Zentrale Konfiguration für alle Custom Shapes.
* Defaults, Minima und Maxima an einer Stelle gepflegt.
*/
// Angaben in cm
export const PUFFER_CONFIG = {
// Defaults
defaultW: 120,
defaultH: 60,
defaultW: 240,
defaultH: 150,
// Minima
minW: 20,
minH: 20,
minW: 240,
minH: 150,
// Maxima
maxW: 500,
maxH: 300,
maxW: 4000,
maxH: 20000,
}
export const KREISEL_CONFIG = {
@@ -20,7 +20,7 @@ export const KREISEL_CONFIG = {
defaultAbstand: 200,
defaultRadius: 80,
// Minima
minAbstand: 20,
minAbstand: 180,
// Maxima
maxAbstand: 4000,
}