Line: Position is getting change while change width from left control in fabric.js 6.3.0...

Discussão em 'Angular' iniciado por yash chapani, Setembro 13, 2024.

  1. yash chapani

    yash chapani Guest

    `if (this.selected.type === 'line') { var newWidth = Math.round(this.selected.width * this.selected.scaleX);

    // Check if the new width is less than 10, if so, set it to 10
    if (newWidth < 50) {
    newWidth = 50;
    this.selected.set({
    scaleX: Number((50 / this.selected.width).toFixed(3)), // Adjust scale to maintain min width
    scaleY: Number((50 / this.selected.width).toFixed(3))
    });
    } else {
    this.selected.width = newWidth;

    }

    // Ensure stroke width is handled appropriately
    this.selected.scaleX = 1;
    this.selected.scaleY = 1;
    this.canvas.renderAll();
    }`


    **Why in this line position change when **

    https://www.loom.com/share/e34a9639ea894e0c82452614b2a1e651 https://www.loom.com/share/e34a9639ea894e0c82452614b2a1e651

    Why in this line position change when

    Continue reading...

Compartilhe esta Página