def update(self, brushinfo): """Retrace the last stroke with a new brush""" layer = self.doc.layer_stack.deepget(self._layer_path) layer.load_snapshot(self._sshot_before) stroke = self._stroke_seq.copy_using_different_brush(brushinfo) layer.render_stroke(stroke) self._stroke_seq = stroke layer.add_stroke_shape(stroke, self._sshot_before) self._sshot_after = layer.save_snapshot()
def update(self, brushinfo): """Retrace the last stroke with a new brush""" model = self.doc layer = model.layer_stack.deepget(self._layer_path) assert self._recording_finished, "Call stop_recording() first" assert self._sshot_after_applied, "command.Brushwork must be applied before being updated" layer.load_snapshot(self._sshot_before) stroke = self._stroke_seq.copy_using_different_brush(brushinfo) layer.render_stroke(stroke) self._stroke_seq = stroke layer.add_stroke_shape(stroke, self._sshot_before) self._sshot_after = layer.save_snapshot()
def update(self, brushinfo): """Retrace the last stroke with a new brush""" model = self.doc layer = model.layer_stack.deepget(self._layer_path) assert self._recording_finished, "Call stop_recording() first" assert self._sshot_after_applied, \ "command.Brushwork must be applied before being updated" layer.load_snapshot(self._sshot_before) stroke = self._stroke_seq.copy_using_different_brush(brushinfo) layer.render_stroke(stroke) self._stroke_seq = stroke layer.add_stroke_shape(stroke, self._sshot_before) self._sshot_after = layer.save_snapshot()