Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions artpaint/tools/Brush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Brush::~Brush()


void
Brush::ModifyBrush(brush_info& info)
Brush::ModifyBrush(brush_info& info, bool notify)
{
delete_all_data();

Expand Down Expand Up @@ -135,7 +135,8 @@ Brush::ModifyBrush(brush_info& info)
shapes[i] = new_polygon;
}

CurrentBrushView::SendMessageToAll(HS_BRUSH_CHANGED);
if (notify == true)
CurrentBrushView::SendMessageToAll(HS_BRUSH_CHANGED);
}


Expand Down
2 changes: 1 addition & 1 deletion artpaint/tools/Brush.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Brush {
Brush(brush_info &info);
~Brush();

void ModifyBrush(brush_info &info);
void ModifyBrush(brush_info &info, bool notify = true);
void CreateDiffBrushes();

float PreviewBrush(BBitmap*);
Expand Down
7 changes: 4 additions & 3 deletions artpaint/tools/ToolManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,13 @@ ToolManager::ReturnActiveToolType() const


status_t
ToolManager::SetCurrentBrush(brush_info* binfo)
ToolManager::SetCurrentBrush(brush_info* binfo, bool notify)
{
// Set the new brush for all tools that use brushes.
if (fActiveBrush == NULL)
fActiveBrush = new Brush(*binfo);
else
fActiveBrush->ModifyBrush(*binfo);
fActiveBrush->ModifyBrush(*binfo, notify);

if (fActiveBrush == NULL)
return B_ERROR;
Expand All @@ -266,7 +266,8 @@ ToolManager::SetCurrentBrush(brush_info* binfo)

fActiveBrush->CreateDiffBrushes();

CurrentBrushView::SendMessageToAll(HS_BRUSH_CHANGED);
if (notify == true)
CurrentBrushView::SendMessageToAll(HS_BRUSH_CHANGED);

return B_OK;
}
Expand Down
2 changes: 1 addition & 1 deletion artpaint/tools/ToolManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ToolManager {
DrawingTool* ReturnActiveTool() const { return fActiveTool; }
int32 ReturnActiveToolType() const;
BView* ConfigView(int32);
status_t SetCurrentBrush(brush_info*);
status_t SetCurrentBrush(brush_info*, bool notify = true);
Brush* GetCurrentBrush();
BPopUpMenu* ToolPopUpMenu();

Expand Down
8 changes: 4 additions & 4 deletions artpaint/windows/BrushStoreWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ BrushStoreWindow::brush_adder(void* data)
Brush* a_brush = new Brush(*(brush_info*)(temp_list.ItemAt(0)));

for (int32 i = 0; i < temp_list.CountItems(); i++) {
a_brush->ModifyBrush(*(brush_info*)(temp_list.ItemAt(i)));
this_pointer->store_view->AddBrush(a_brush);
a_brush->ModifyBrush(*(brush_info*)(temp_list.ItemAt(i)), false);
this_pointer->store_view->AddBrush(a_brush, false);
}

delete a_brush;
Expand Down Expand Up @@ -483,7 +483,7 @@ BrushStoreView::MouseDown(BPoint point)


bool
BrushStoreView::AddBrush(Brush* brush)
BrushStoreView::AddBrush(Brush* brush, bool notify)
{
bool added = false;

Expand Down Expand Up @@ -517,7 +517,7 @@ BrushStoreView::AddBrush(Brush* brush)
Draw(Bounds());
}

ToolManager::Instance().SetCurrentBrush(((brush_info*)brush_data->ItemAt(index)));
ToolManager::Instance().SetCurrentBrush(((brush_info*)brush_data->ItemAt(index)), notify);

ResizeBy(-1, 0);
ResizeBy(1, 0);
Expand Down
4 changes: 2 additions & 2 deletions artpaint/windows/BrushStoreWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class BrushStoreView : public BView {
void KeyDown(const char* bytes, int32);
void MouseDown(BPoint);

bool AddBrush(Brush*);
bool AddBrush(Brush*, bool notify = true);
};


Expand All @@ -63,7 +63,7 @@ class BrushStoreWindow : public BWindow {

static void writeBrushes(BFile&);
static void readBrushes(BFile&);
static void AddBrush(Brush*);
static void AddBrush(Brush* brush);
static void DeleteBrush(int32);

static void showWindow();
Expand Down