Closed maximilian-franz closed 3 years ago
The tests are well done. I suggest we add one more test which asserts the pencil (and geometric forms) remains as it is when changing the brush size.
On further thought, it might make sense to make the eraser adjustable as well even though it's not part of the user story. Then we would have to inform the customer about this.
We noticed that
On further thought, it might make sense to make the eraser adjustable as well even though it's not part of the user story. Then we would have to inform the customer about this.
We actually noticed, that the eraser size is indeed part of the User Story, but the necessary changes are only very few (I am actually going to implement them right now 🤓)
Even though the circle brush works well, the triangle and rectangle brush have an unwanted offset now.
Even though the circle brush works well, the triangle and rectangle brush have an unwanted offset now.
UPDATE: Fixed it (hopefully)!
Well, that was probably the reason for the penNibOffset
😅
Calculation: (self sourceForm extent / 2) floor
drawRectangle
self isErasing: false.
self pen sourceForm: ((Form extent: self rectangleBrushSize) fillBlack).
self mode: #pen.
self currentTool: #drawRectangle
drawTriangle
self isErasing: false.
self pen sourceForm: self prepareTrianglePenSource.
self mode: #pen.
self currentTool: #drawTriangle
prepareTrianglePenSource
| triangleForm temporaryPen |
triangleForm := Form extent: self brushSize asPoint.
temporaryPen := (Pen newOnForm: triangleForm)
place: 0 @ (self brushSize - 1);
turn: 90;
yourself.
1 to: 3 do: [:i | temporaryPen go: self brushSize; turn: -120].
triangleForm convexShapeFill: Color black.
^ triangleForm
Regardless of the name of the class, it should have a description.
Closes #30