Skip to content

Commit

Permalink
Fixed weight brush
Browse files Browse the repository at this point in the history
  • Loading branch information
ousnius committed Jul 22, 2015
1 parent 460afc5 commit 5a4e1bd
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions OutfitStudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4191,8 +4191,8 @@ void wxGLPanel::UpdateBrushStroke(const wxPoint& screenPos) {
string selectedBone = os->outfitBones->GetItemText(selItems.front());
if (os->boneScale) {
int boneScalePos = os->boneScale->GetValue();
os->ActiveShapeUpdated(strokeManager->GetCurStateStroke(), false, false);
os->project->ApplyBoneScale(selectedBone, boneScalePos);
os->ActiveShapeUpdated(strokeManager->GetCurStateStroke(), false, false);
}
}
}
Expand All @@ -4204,9 +4204,6 @@ void wxGLPanel::EndBrushStroke() {
activeStroke->endStroke();

OutfitStudio* os = (OutfitStudio*)notifyWindow;
if (activeStroke->BrushType() != TBT_MASK)
os->ActiveShapeUpdated(strokeManager->GetCurStateStroke());

if (activeStroke->BrushType() == TBT_WEIGHT && os->outfitBones) {
wxArrayTreeItemIds selItems;
os->outfitBones->GetSelections(selItems);
Expand All @@ -4219,6 +4216,9 @@ void wxGLPanel::EndBrushStroke() {
}
}

if (activeStroke->BrushType() != TBT_MASK)
os->ActiveShapeUpdated(strokeManager->GetCurStateStroke());

activeStroke = nullptr;
activeBrush = savedBrush;
}
Expand Down Expand Up @@ -4330,11 +4330,6 @@ bool wxGLPanel::UndoStroke() {
bool ret = strokeManager->backStroke(skip);
if (!skip && ret) {
OutfitStudio* os = (OutfitStudio*)notifyWindow;
if (curStroke && curStroke->BrushType() != TBT_MASK) {
os->ActiveShapeUpdated(curStroke, true);
if (curStroke->BrushType() == TBT_XFORM)
ShowTransformTool(true, false);
}
if (curStroke && curStroke->BrushType() == TBT_WEIGHT && os->outfitBones) {
wxArrayTreeItemIds selItems;
os->outfitBones->GetSelections(selItems);
Expand All @@ -4346,6 +4341,12 @@ bool wxGLPanel::UndoStroke() {
}
}
}

if (curStroke && curStroke->BrushType() != TBT_MASK) {
os->ActiveShapeUpdated(curStroke, true);
if (curStroke->BrushType() == TBT_XFORM)
ShowTransformTool(true, false);
}
}

Refresh();
Expand All @@ -4359,11 +4360,6 @@ bool wxGLPanel::RedoStroke() {
TweakStroke* curStroke = strokeManager->GetCurStateStroke();
if (!skip && ret) {
OutfitStudio* os = (OutfitStudio*)notifyWindow;
if (curStroke->BrushType() != TBT_MASK) {
os->ActiveShapeUpdated(curStroke);
if (curStroke->BrushType() == TBT_XFORM)
ShowTransformTool(true, false);
}
if (curStroke->BrushType() == TBT_WEIGHT) {
wxArrayTreeItemIds selItems;
os->outfitBones->GetSelections(selItems);
Expand All @@ -4375,6 +4371,12 @@ bool wxGLPanel::RedoStroke() {
}
}
}

if (curStroke->BrushType() != TBT_MASK) {
os->ActiveShapeUpdated(curStroke);
if (curStroke->BrushType() == TBT_XFORM)
ShowTransformTool(true, false);
}
}
Refresh();
return ret;
Expand Down

0 comments on commit 5a4e1bd

Please sign in to comment.