2006-10-01 19:08:26 +02:00
|
|
|
import gtk
|
|
|
|
|
|
|
|
COLS = 16
|
|
|
|
ROWS = 12
|
|
|
|
|
|
|
|
class Grid(object):
|
|
|
|
def __init__(self):
|
|
|
|
self._factor = gtk.gdk.screen_width() / COLS
|
|
|
|
|
2006-10-02 01:50:43 +02:00
|
|
|
def point(self, x, y):
|
2006-10-01 19:08:26 +02:00
|
|
|
return [x * self._factor, y * self._factor]
|
|
|
|
|
|
|
|
def rectangle(self, x, y, width, height):
|
|
|
|
return [x * self._factor, y * self._factor,
|
|
|
|
width * self._factor, height * self._factor]
|