Closed DeepankarGupta13 closed 2 years ago
Hi,
I think it's the expected behavior 🤔.
Sir, if i want to add my text at (20,20) and the text justify should be middle center. How i should i do that?
Ohhhh the text is moved to the 0,0 when using alignement.
This is a bug I will fix it.
Update to v2.5.3
and try this:
import { DxfWriter, point3d, TextHorizontalAlignment, TextVerticalAlignment } from "@tarikjabiri/dxf";
const dxf = new DxfWriter();
dxf.addText(point3d(20, 20), 1, 'GGWP', {
rotation: 30,
horizontalAlignment: TextHorizontalAlignment.Center,
verticalAlignment: TextVerticalAlignment.Middle,
secondAlignmentPoint: point3d(20, 20),
});
thank you sir.
when I am doing this function drawText() { const text = dxf.addText(point3d(20, 20, 0), 1, 'GGWP', { rotation: 30, horizontalAlignment: 1, verticalAlignment: 2, }) console.log('text: ', text); } the position of the text becomes origin I tried second alignment point also text.secondAlignmentPoint = point3d(20, 20, 0); it is also not working pls help