[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-dev] Stroke selection fix



This one line change fixes the crash when selecting a stroke shape from
the line gallery. It turns out that the FreeHandInfoBar was catching the
message that a stroke shape was selected, and attempting to change the
value in the dropdown list. This was happening even if the freehand tool
wasn't selected, and hence the info bar wasn't displayed.

There are two places in the FreeHandInfoBarOp::Message function where
SetStrokeComboFromSelection() is called. The one is executed
conditionally if ControlsExist and IsVisible(), but the other one was
not, so this was an easy fix.
Index: tools/freeinfo.cpp
===================================================================
--- tools/freeinfo.cpp	(revision 1766)
+++ tools/freeinfo.cpp	(working copy)
@@ -474,7 +474,7 @@
 		}
 
 		// if it is a stroke message then update our combo
-		if (Message->IsKindOf(CC_RUNTIME_CLASS(StrokeMsg)))
+		if (Message->IsKindOf(CC_RUNTIME_CLASS(StrokeMsg)) && ControlsExist && IsVisible())
 			SetStrokeComboFromSelection();
 
 		// likewise if it is a screen change message