Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
現在、lineTo() を使用して描画されたすべての線に対して単一の 2d コンテキスト/キャンバスがありますが、キャンバス全体を再描画するか、状態を保存しないと不可能な元に戻す/やり直し機能を実装したかった ( 1、2 )。
他の方法と比較して、スタックに描画された行ごとに新しいキャンバスをプッシュすることに不利な点はありますか? 時間の複雑さの観点から、元に戻す/やり直しは O(n) ではなく O(1) になりますが、他の問題があるかどうかはわかりません。