Handle für Y-Grösse des Puffers funktinoierte nicht korrekt.
This commit is contained in:
@@ -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 },
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user