Commit 38c7880
committed
Squashed commit of:
Refactor ImageView drawing to remove checker background from render
- Set default for "bg" parameter in Image::Render to false so it doesn't draw the checker bg
- Remove code to render the checker bg in Image::DoRenderPreview
- In ImageView add checker bg bitmap. it is the size of two checker squares and is drawn as a tiled
bitmap first thing in the ImageView::Draw function. the bitmap is drawn in the ImageView::MakeBackground()
function and this is also called when the settings change to redraw the background bitmap
- in ImageView::Draw the background is drawn first and the brush drawing was also moved here. this is
because in Haiku drawing should happen only in the Draw() function so other Draw commands were removed
unless in functions called by Draw().
- ImageView::BlitImage() uses alpha drawing mode to draw the changed bitmap parts
- ImageView::UpdateImage() uses Invalidate() to force redraw but doesn't use BlitImage() anymore
- ImageView::MouseDown() invalidates window region when scrolling view to force redraw
- ImageView::MouseUp() code is not needed because DrawBrush happens in Draw()
- ImageView::MouseMoved() invalidates area where brush is drawn but doesn't draw brush because it
happens in Draw() function. Also the Draw() when the mouse leaves the view is changed to Invalidate()
- ImageView::DrawBrush() clear code is not needed because Draw erases the bg before calling DrawBrush.
Also calls to Draw are replaced by Invalidate()
- A few tools (FreeLineTool, EraserTool, HairyBrushTool) make sure updated_rect is within the image bounds
to prevent crashes
Refactor Color Selector tool to stop drawing directly to ImageView
- Removed drawing / erasing code from ColorSelectorTool::UseTool
- in ImageView::DrawBrush draw rect for color selection
Refactor SelectorTool to not draw directly to ImageView
- add SelectorTool to ImageView::DrawBrush so selection draws during Draw() function
- in SelectorTool store the points for a selection in progress. "selectionPoints" is for
drawing selections like rectangle or ellipse. "activePoints" is needed for intelligent scissors
because there is the part currenyly being drawn and then "selectionPoints" is for the part that the user
drew before clicking the mouse.
- add SelectorTool::DrawSelection function to draw in progress selections based on points stored
in SelectorTool::UseTool
- removed drawing code from SelectorTool::UseTool. store points for selections. use ImageUpdater
like other drawing tools to update the image instead of drawing directly to the view1 parent b747948 commit 38c7880
12 files changed
Lines changed: 321 additions & 210 deletions
File tree
- artpaint
- paintwindow
- tools
- viewmanipulators
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1490 | 1490 | | |
1491 | 1491 | | |
1492 | 1492 | | |
1493 | | - | |
1494 | | - | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
1498 | | - | |
1499 | | - | |
1500 | | - | |
1501 | | - | |
1502 | | - | |
1503 | | - | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
1504 | 1496 | | |
1505 | | - | |
1506 | | - | |
1507 | | - | |
1508 | | - | |
1509 | | - | |
1510 | | - | |
1511 | | - | |
1512 | | - | |
1513 | | - | |
1514 | | - | |
| 1497 | + | |
1515 | 1498 | | |
1516 | 1499 | | |
1517 | 1500 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
| 95 | + | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
0 commit comments