DmitryBaranovskiy / raphael

JavaScript Vector Library
https://dmitrybaranovskiy.github.io/raphael/
MIT License
11.27k stars 1.67k forks source link

Offset Path #1139

Open ehsan1011 opened 2 years ago

ehsan1011 commented 2 years ago

Hi, How can I offset a path? Not Scale. Please see the image below: https://pasteboard.co/B7e9Xa1mJNDf.jpg

Thank you

ibrierley commented 2 years ago

Transform it with a translate ? eg

el.transform("t100,100")
ehsan1011 commented 2 years ago

Thank you dear @ibrierley, but I need to offset the shape of the path around path not just change position. Please see the picture below: https://pasteboard.co/B7e9Xa1mJNDf.jpg

ibrierley commented 2 years ago

Pictures aren't really clear (to me anyway), what you are trying to achieve.

ehsan1011 commented 2 years ago

Hello again, I have a parallelogram that I want to enlarge by keeping the angles. Because the shape has different angles, when I use the Scale command, not everyone around the shape gets the same size. For example, consider the figure below that we want to make it 100 pixels larger on all sides. https://s6.uupload.ir/files/new_cect.jpg Scale in not good enough, How can I offset this shape? Thank you very much

ibrierley commented 2 years ago

I think you would need to recalculate the original points in the shape.

ehsan1011 commented 2 years ago

Yeah, Thank you