All pastes #87074 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-07-13 16:24 UTC
rendered paste body
function zoom(amount)
{
    xoffset = startWidth * (map._x - startx) / (100 / amount * map._width);
    yoffset = startHeight * (map._y - starty) / (100 / amount * map._height);
    map._xscale = map._xscale + amount;
    map._yscale = map._yscale + amount;
    map._x = map._x + xoffset;
    map._y = map._y + yoffset;
    y_coord = map._y;
    x_coord = map._x;
    scale = int(map._xscale) + "% view";
    if (map._xscale <= 50)
    {
        map._xscale = 50;
        map._yscale = 50;
        scale = int(map._xscale) + "% view";
    } // end if
} // End of the function
function reset()
{
    map._x = startx;
    map._y = starty;
    map._xscale = 100;
    map._yscale = 100;
    scale = "100% view";
} // End of the function