File tree Expand file tree Collapse file tree
app/src/main/java/com/ethran/notable/editor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ fun EditorView(
137137 // Initialize ViewModel with persisted settings on first composition
138138 LaunchedEffect (Unit ) {
139139 viewModel.initFromPersistedSettings(editorSettingCacheManager.getEditorSettings())
140+ viewModel.updateDrawingState()
140141 }
141142
142143 val editorControlTower = remember {
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import com.ethran.notable.data.datastore.GlobalAppSettings
1313import com.ethran.notable.data.db.getPageIndex
1414import com.ethran.notable.data.db.getParentFolder
1515import com.ethran.notable.data.model.BackgroundType
16+ import com.ethran.notable.editor.EditorViewModel.Companion.DEFAULT_PEN_SETTINGS
1617import com.ethran.notable.editor.canvas.CanvasEventBus
1718import com.ethran.notable.editor.state.Mode
1819import com.ethran.notable.editor.state.SelectionState
@@ -71,7 +72,8 @@ data class ToolbarUiState(
7172 val mode : Mode = Mode .Draw ,
7273 val pen : Pen = Pen .BALLPEN ,
7374 val eraser : Eraser = Eraser .PEN ,
74- val penSettings : Map <String , PenSetting > = emptyMap(),
75+ // TODO: if it is an emptyMap(), the DrawCanvas crashes, to be fixed.
76+ val penSettings : Map <String , PenSetting > = DEFAULT_PEN_SETTINGS ,
7577 val isSelectionActive : Boolean = false ,
7678 val hasClipboard : Boolean = false ,
7779 val isDrawing : Boolean = true ,
You can’t perform that action at this time.
0 commit comments