Refactor Color Selector tool to stop drawing directly to ImageView#686
Closed
HiCamino wants to merge 1 commit into
Closed
Refactor Color Selector tool to stop drawing directly to ImageView#686HiCamino wants to merge 1 commit into
HiCamino wants to merge 1 commit into
Conversation
- 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
62145f8 to
d8a2fae
Compare
Member
|
Superceded by #687 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This code needs HiCamino@1f79d69 to work properly
MUST TEST with #685 applied first