Computes which cells are visible at the current pan and zoom settings given a cell size in pixels.
Computes which cells are visible at the current pan and zoom settings given a cell size in pixels. Cells are assumed to be square.
Width (or height) of a the square cell, in pixels
Number of rows of cells
Number of columns of cells
(firstRow, firstCol, lastRow, lastCol)
Pans the view according to mouse movement.
Sets current zoom factor; zooms about screen center
Multiplies current zoom level by amt; zooms about the given point in image coordinates.
Zooms about last mouse-down location; zoom amount is determined by the delta between the current mouse location and the mouse down location.
Multiplies current zoom level by amt; zooms about screen center
Augments a panel with mouse pan and zoom capability (sort of like your favorite online maps application).
Rather than mixing in this trait directly to some panel displaying the visual that you want to pan and zoom, you should wrap that panel in another panel and mix in this trait to the wrapper. This helps guarantee clean redraws of the panel (otherwise a screen clear can "miss" due to the applied pan and zoom).