MrFrankel / ruler

HTML5 Canvas ruler for authoring tools
http://mrfrankel.github.io/ruler/
221 stars 56 forks source link

Different rulers on the same page #3

Closed zaicef closed 7 years ago

zaicef commented 7 years ago

Hello,

Is it possible to initiate a ruler for a div (eg. class="ruler1") with a specific set of options (rulerHeight,fontSize,scale etc..) and a second ruler for another div (eg. class="ruler2") with another set of options in the same page?

MrFrankel commented 7 years ago

Hey,

Currently no, but it should be a big issue adding the capability. Ill try and push a fix for it tomorrow.

zaicef commented 7 years ago

Thanks! It will be very useful!

MrFrankel commented 7 years ago

Just pushed a new version. Please note that the API has changed, you now have to call: var myRuler = new ruler({container: document.querySelector('#stage')}); where myRuler is an instance of a controller for the specific canvas.

all API calls are now under myRuler.api

Haven't had time to test it much so let me know if there are any issues