two.js
                                
                                
                                
                                    two.js copied to clipboard
                            
                            
                            
                        [Bug] ZUI addLimits should include translations
Describe the bug
zui.addLimits(0.2, 2, 'scale') works well, but zui.addLimits(0, 1000, 'x') and zui.addLimits(0, 1000, 'y') not working as what I expected.
To Reproduce
var two = new Two({
  fullscreen: true,
  autostart: true,
  type: Two.Types.canvas
})
two.appendTo(document.body)
var zui = new Two.ZUI(stage)
Expected behavior
It should be works for the limitation of x and y when zui.translateSurface(dx, dy)
Screenshots If applicable, add screenshots to help explain your problem.
Environment (please select one):
- [x] Code executes in browser (e.g: using script tag to load library)
 
<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/two.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/extras/js/zui.js"></script>
Desktop (please complete the following information):
- Browser [chrome]
 
zui.addLimit is only for scale. There aren't limits / boundaries for panning.