restoreState method

  1. @override
PCanvasState? restoreState({
  1. PCanvasState? expectedState,
})
override

Restores the drawing state.

Implementation

@override
PCanvasState? restoreState({PCanvasState? expectedState}) {
  _ctx.resetTransform();

  final s = super.restoreState(expectedState: expectedState);

  var stateExtra = s?.stateExtra as PCanvasHTMLStateExtra?;
  stateExtra?.setContext(_ctx);

  return s;
}