how to create an axis for dropshadow using mgraphics and paint function

Bogdan Yegolayev's icon

Hi,

We are making a dial and we wanted to have a shadow for our dial. its in a paintshadow() function with a little offset using translate(). We want it to rotate around a different axis. But the rotate() function does only work for the code after the rotate and not in between of the paint function. Is there a dropshadow function or a way to isolate rotate() function in the paint() function?

Dial shape.js.zip
zip

TFL's icon

Not sure what you want to achieve but I feel like you're missing the save() and restore() Mgraphics methods. I inserted them in your file so you can get a sense of how it works, even though the current result is likely not what you're looking for.

Dial shape_with_save_restore.zip
zip


Bogdan Yegolayev's icon

Tnx for your comment! It works, now the dial has its own shadow.

Dial shape.js.zip
zip