refactored fitToViewer() to call the new fitSelection() function internally
made the zoom in tool to respect the toolbarProps.SVGAlignX/Y props. If for instance toolbarProps.SVGAlignX is set to center, drawing a rectangle to zoom in will now center the selected area in the view.
updated the documentation to reflect the changes above
Added typescript support:
added index.d.ts file and updated package.json accordingly
the index.d.ts file is based on the types defined in the DefinitelyTyped repo:
Added ability to control alignment in
fitSelection()
and "zoom in" tool:SVGAlignX
andSVGAlignY
parameters infitSelection()
:fitSelection(value, selectionSVGPointX, selectionSVGPointY, selectionWidth, selectionHeight, SVGAlignX=ALIGN_LEFT, SVGAlignY=ALIGN_TOP)
fitToViewer()
to call the newfitSelection()
function internallyzoom in
tool to respect thetoolbarProps.SVGAlignX/Y
props. If for instancetoolbarProps.SVGAlignX
is set tocenter
, drawing a rectangle to zoom in will now center the selected area in the view.Added typescript support:
index.d.ts
file and updatedpackage.json
accordinglyindex.d.ts
file is based on the types defined in the DefinitelyTyped repo:fitSelection()
as well.Note: if you prefer to not have typescript support in your project, see PR #225