Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[부나] 뷰 챌린지 미션 2단계 제출합니다. #32

Merged
merged 25 commits into from
Oct 10, 2023
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
150aaa4
refactor: PaletteView에서 자식 View를 추가하는 메서드 분리
tmdgh1592 Oct 7, 2023
a268808
refactor: ColorView 별도의 클릭 콜백을 제거하고 ClickListener 사용하도록 변경
tmdgh1592 Oct 7, 2023
5f84342
feat: 도형 목록 뷰를 보여주는 기능 구현
tmdgh1592 Oct 7, 2023
bb05430
feat: 팔레트 모드 선택 뷰 구현
tmdgh1592 Oct 7, 2023
2abb2b3
refactor: PathPainter가 Painter를 구현하도록 변경
tmdgh1592 Oct 7, 2023
8253c03
feat: 사각형을 그리는 기능 구현
tmdgh1592 Oct 7, 2023
cde6d59
refactor: 도형의 로직을PainterHistory로 이동
tmdgh1592 Oct 7, 2023
75af299
refactor: RECTANGLE_PAINT를 DEFAULT_PAINT로 변경
tmdgh1592 Oct 7, 2023
b911f82
feat: 원을 그리는 기능 구현
tmdgh1592 Oct 7, 2023
10ec0d1
feat: 팔레트 취소(undo),재실행(redo) 구현
tmdgh1592 Oct 7, 2023
c0abff7
feat: 캔버스 전체 초기화 기능 구현
tmdgh1592 Oct 8, 2023
d550c72
feat: 지우개 기능 구현
tmdgh1592 Oct 8, 2023
83f99c2
refactor: 패키지 분리
tmdgh1592 Oct 8, 2023
efeed27
fix: BrushPainter의 Paint 변경 안 되는 버그 수정
tmdgh1592 Oct 8, 2023
9b47dc0
fix: Painter의 Paint 변경 안 되는 버그 수정
tmdgh1592 Oct 8, 2023
349e7a3
refactor(PainterHistory): onActionUp() 메서드의 인자 제거
tmdgh1592 Oct 9, 2023
e0745ed
refactor(BrushPainter): Paint 프로퍼티를 private으로 변경
tmdgh1592 Oct 9, 2023
5e375a4
refactor(CirclePainter): 원을 그리는 기능을 drawOval() 메서드를 사용하도록 변경
tmdgh1592 Oct 9, 2023
05c9212
refactor(Painter): changePainter() 메서드를 expression으로 변경
tmdgh1592 Oct 9, 2023
2dc35ca
refactor(PaletteView): 두께, 색상 프로퍼티를 private set으로 변경
tmdgh1592 Oct 9, 2023
72ac21c
fix: Painter 변경시 두께, 색상, 도형 상태가 초기화되는 버그 수정
tmdgh1592 Oct 9, 2023
0a527af
refactor: CirclePainter, RectanglePainter가 ShapePainter를 구현하도록 변경
tmdgh1592 Oct 9, 2023
8a34250
refactor: Painter의 속성들을 PainterState에서 관리하도록 변경
tmdgh1592 Oct 9, 2023
0141913
refactor: 패키지 분리
tmdgh1592 Oct 9, 2023
0a2ae50
refactor(Painter): Painter 팩토리 함수를 동반 객체로 변경
tmdgh1592 Oct 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(Painter): changePainter() 메서드를 expression으로 변경
  • Loading branch information
tmdgh1592 committed Oct 9, 2023
commit 05c92124702058eb3a7ac4b7551a35f005bc6bcf
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ interface Painter {
fun changePainter(
paletteMode: PaletteMode,
paletteShape: PaletteShape = PaletteShape.values().first(),
): Painter {
return when (paletteMode) {
PaletteMode.BRUSH -> BrushPainter()
PaletteMode.SHAPE -> getShapePainter(paletteShape)
PaletteMode.ERASER -> PathEraserPainter()
}
): Painter = when (paletteMode) {
PaletteMode.BRUSH -> BrushPainter()
PaletteMode.SHAPE -> getShapePainter(paletteShape)
PaletteMode.ERASER -> PathEraserPainter()
}

private fun getShapePainter(
Expand Down