Start drawing from the actual start point
This commit is contained in:
parent
2174b6e0fd
commit
bd8b2437a6
@ -1,4 +1,4 @@
|
|||||||
AC_INIT([Sugar],[0.5],[],[sugar])
|
AC_INIT([Sugar],[0.6],[],[sugar])
|
||||||
|
|
||||||
AC_PREREQ([2.59])
|
AC_PREREQ([2.59])
|
||||||
|
|
||||||
@ -21,6 +21,7 @@ sugar/Makefile
|
|||||||
sugar/__installed__.py
|
sugar/__installed__.py
|
||||||
sugar/browser/Makefile
|
sugar/browser/Makefile
|
||||||
sugar/chat/Makefile
|
sugar/chat/Makefile
|
||||||
|
sugar/chat/sketchpad/Makefile
|
||||||
sugar/p2p/Makefile
|
sugar/p2p/Makefile
|
||||||
sugar/p2p/model/Makefile
|
sugar/p2p/model/Makefile
|
||||||
sugar/shell/Makefile
|
sugar/shell/Makefile
|
||||||
|
@ -16,4 +16,6 @@ activitydir = $(pkgdatadir)/activities
|
|||||||
activity_DATA = browser.activity
|
activity_DATA = browser.activity
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
|
$(rc_DATA) \
|
||||||
|
$(activity_DATA) \
|
||||||
$(icon_DATA)
|
$(icon_DATA)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
SUBDIRS = sketchpad
|
||||||
|
|
||||||
sugardir = $(pythondir)/sugar/chat
|
sugardir = $(pythondir)/sugar/chat
|
||||||
sugar_PYTHON = \
|
sugar_PYTHON = \
|
||||||
__init__.py \
|
__init__.py \
|
||||||
@ -12,4 +14,6 @@ icon_DATA = \
|
|||||||
activitydir = $(pkgdatadir)/activities
|
activitydir = $(pkgdatadir)/activities
|
||||||
activity_DATA = chat.activity
|
activity_DATA = chat.activity
|
||||||
|
|
||||||
EXTRA_DIST = $(icon_DATA)
|
EXTRA_DIST = \
|
||||||
|
$(icon_DATA) \
|
||||||
|
$(activity_DATA)
|
||||||
|
@ -41,18 +41,23 @@ class SketchPad(gtk.DrawingArea):
|
|||||||
def add_sketch(self, sketch):
|
def add_sketch(self, sketch):
|
||||||
self._sketches.append(sketch)
|
self._sketches.append(sketch)
|
||||||
|
|
||||||
def __button_press_cb(self, widget, event):
|
def add_point(self, event):
|
||||||
self._active_sketch = Sketch()
|
|
||||||
self.add_sketch(self._active_sketch)
|
|
||||||
|
|
||||||
def __button_release_cb(self, widget, event):
|
|
||||||
self._active_sketch = None
|
|
||||||
|
|
||||||
def __motion_notify_cb(self, widget, event):
|
|
||||||
if self._active_sketch:
|
if self._active_sketch:
|
||||||
self._active_sketch.add_point(event.x, event.y)
|
self._active_sketch.add_point(event.x, event.y)
|
||||||
self.window.invalidate_rect(None, False)
|
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):
|
||||||
|
self.add_point(event)
|
||||||
|
|
||||||
def to_svg(self):
|
def to_svg(self):
|
||||||
d = drawing()
|
d = drawing()
|
||||||
s = svg()
|
s = svg()
|
||||||
|
Loading…
Reference in New Issue
Block a user