Start drawing from the actual start point

This commit is contained in:
Marco Pesenti Gritti 2006-05-21 18:55:37 -04:00
parent 2174b6e0fd
commit bd8b2437a6
4 changed files with 17 additions and 5 deletions

View File

@ -1,4 +1,4 @@
AC_INIT([Sugar],[0.5],[],[sugar])
AC_INIT([Sugar],[0.6],[],[sugar])
AC_PREREQ([2.59])
@ -21,6 +21,7 @@ sugar/Makefile
sugar/__installed__.py
sugar/browser/Makefile
sugar/chat/Makefile
sugar/chat/sketchpad/Makefile
sugar/p2p/Makefile
sugar/p2p/model/Makefile
sugar/shell/Makefile

View File

@ -16,4 +16,6 @@ activitydir = $(pkgdatadir)/activities
activity_DATA = browser.activity
EXTRA_DIST = \
$(rc_DATA) \
$(activity_DATA) \
$(icon_DATA)

View File

@ -1,3 +1,5 @@
SUBDIRS = sketchpad
sugardir = $(pythondir)/sugar/chat
sugar_PYTHON = \
__init__.py \
@ -12,4 +14,6 @@ icon_DATA = \
activitydir = $(pkgdatadir)/activities
activity_DATA = chat.activity
EXTRA_DIST = $(icon_DATA)
EXTRA_DIST = \
$(icon_DATA) \
$(activity_DATA)

View File

@ -41,17 +41,22 @@ class SketchPad(gtk.DrawingArea):
def add_sketch(self, sketch):
self._sketches.append(sketch)
def add_point(self, event):
if self._active_sketch:
self._active_sketch.add_point(event.x, event.y)
self.window.invalidate_rect(None, False)
def __button_press_cb(self, widget, event):
self._active_sketch = Sketch()
self.add_sketch(self._active_sketch)
self.add_point(event)
def __button_release_cb(self, widget, event):
self.add_point(event)
self._active_sketch = None
def __motion_notify_cb(self, widget, event):
if self._active_sketch:
self._active_sketch.add_point(event.x, event.y)
self.window.invalidate_rect(None, False)
self.add_point(event)
def to_svg(self):
d = drawing()