-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from creme332/repaint
implement layered canvas to fix painting bug
- Loading branch information
Showing
10 changed files
with
257 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/com/github/creme332/controller/ZoomPanelController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.github.creme332.controller; | ||
|
||
import com.github.creme332.model.CanvasModel; | ||
import com.github.creme332.view.ZoomPanel; | ||
|
||
public class ZoomPanelController { | ||
CanvasModel model; | ||
ZoomPanel view; | ||
|
||
public ZoomPanelController(CanvasModel model, ZoomPanel view) { | ||
this.model = model; | ||
this.view = view; | ||
|
||
// Add action listeners for the zoom panel buttons | ||
view.getHomeButton().addActionListener(e -> model.resetZoom()); | ||
view.getZoomInButton().addActionListener(e -> model.updateCanvasZoom(true)); | ||
view.getZoomOutButton().addActionListener(e -> model.updateCanvasZoom(false)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.