fluttercandies / flutter_drawing_board

A new Flutter package of drawing board
MIT License
178 stars 62 forks source link

[Feature request] Should have a function to reset the canvas to its initial size and position. #41

Closed SM-SHIFAT closed 6 months ago

SM-SHIFAT commented 9 months ago

Platforms

Android

Description

Need a function to call which reset the size and position to its initial size and position. Like back to the position where it was when its initialized. Otherwise can you stop it from totally going out of screen boundary?

Why

When dragging the canvas , some times it goes out of the sceen thats looks odd. so on a press of a button it should be back to its original position.

xSILENCEx commented 6 months ago
final TransformationController _transformationController = TransformationController();

DrawingBoard(
    transformationController: _transformationController,
)

then use _transformationController.value = Matrix4.identity(); to reset the canvas