svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.01k stars 1.07k forks source link

The method "elment.previous()" doesn't work. #1216

Closed qingyun1988 closed 11 months ago

qingyun1988 commented 2 years ago
var canvas = SVG().addTo('#canvas').size('100%', '100%')

var rect0 = canvas.rect(100, 100).move(100, 100).fill('blue');
var rect1 = canvas.rect(100,100);
var rect2 = canvas.rect(100, 100).move(100, 100).fill('red');

var test = rect1.previous();

get error: Uncaught TypeError: rect1.previous is not a functio

qingyun1988 commented 2 years ago

I already know the answer that the method 'previous()' needs to be modified to 'prev()'. But the description of the method in svgjs.dev's doc is ‘previous()’ instead of 'prev()'.

Please modify it to make the description clear.

Fuzzyma commented 2 years ago

Feel free to make the change in the doc repository. We always welcome pull requests :)