Author: toshok
Date: 2007-10-18 15:48:54 -0400 (Thu, 18 Oct 2007)
New Revision: 87793
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/animation.cpp
trunk/moon/src/animation.h
trunk/moon/src/clock.cpp
trunk/moon/src/dependencyobject.h
Log:
2007-10-18 Chris Toshok <[EMAIL PROTECTED]>
* dependencyobject.h: fix comment.
* animation.h, animation.cpp: use the
Clock::CurrentStateInvalidated event to reset the property value
to baseValue instead of overriding the Clock::Stop method. This
fixes clocks with FillBehavior="Stop" instead of storyboard with
FillBehavior="Fill".
* clock.cpp (Clock::Tick): remove a stupid block of code that was
causing clocks which were Filling to spontaneously end up in their
Active state again.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-10-18 19:48:16 UTC (rev 87792)
+++ trunk/moon/src/ChangeLog 2007-10-18 19:48:54 UTC (rev 87793)
@@ -1,3 +1,17 @@
+2007-10-18 Chris Toshok <[EMAIL PROTECTED]>
+
+ * dependencyobject.h: fix comment.
+
+ * animation.h, animation.cpp: use the
+ Clock::CurrentStateInvalidated event to reset the property value
+ to baseValue instead of overriding the Clock::Stop method. This
+ fixes clocks with FillBehavior="Stop" instead of storyboard with
+ FillBehavior="Fill".
+
+ * clock.cpp (Clock::Tick): remove a stupid block of code that was
+ causing clocks which were Filling to spontaneously end up in their
+ Active state again.
+
2007-10-18 Sebastien Pouliot <[EMAIL PROTECTED]>
* geometry.cpp: New code to handle arc segments. No known issues
Modified: trunk/moon/src/animation.cpp
===================================================================
--- trunk/moon/src/animation.cpp 2007-10-18 19:48:16 UTC (rev 87792)
+++ trunk/moon/src/animation.cpp 2007-10-18 19:48:54 UTC (rev 87793)
@@ -37,6 +37,7 @@
{
clock->AddHandler (clock->CurrentTimeInvalidatedEvent,
update_property_value, this);
+ clock->AddHandler (clock->CurrentStateInvalidatedEvent,
reset_property_value, this);
targetobj->AddHandler (EventObject::DestroyedEvent,
target_object_destroyed, this);
baseValue = new Value(*targetobj->GetValue (targetprop));
@@ -76,12 +77,19 @@
}
void
+AnimationStorage::reset_property_value (EventObject *, gpointer, gpointer
closure)
+{
+ ((AnimationStorage*)closure)->ResetPropertyValue ();
+}
+
+void
AnimationStorage::ResetPropertyValue ()
{
if (targetobj == NULL)
return;
- targetobj->SetValue (targetprop, *baseValue);
+ if (clock->GetClockState() == Clock::Stopped)
+ targetobj->SetValue (targetprop, *baseValue);
}
AnimationStorage::~AnimationStorage ()
@@ -109,13 +117,6 @@
return timeline->GetCurrentValue (defaultOriginValue,
defaultDestinationValue, this);
}
-void
-AnimationClock::Stop ()
-{
- storage->ResetPropertyValue();
- Clock::Stop();
-}
-
AnimationClock::~AnimationClock ()
{
if (storage)
Modified: trunk/moon/src/animation.h
===================================================================
--- trunk/moon/src/animation.h 2007-10-18 19:48:16 UTC (rev 87792)
+++ trunk/moon/src/animation.h 2007-10-18 19:48:54 UTC (rev 87793)
@@ -119,7 +119,6 @@
DependencyObject *targetobj, DependencyProperty
*targetprop);
~AnimationStorage ();
- void ResetPropertyValue ();
private:
void TargetObjectDestroyed ();
static void target_object_destroyed (EventObject *sender, gpointer
calldata, gpointer data);
@@ -127,6 +126,9 @@
void UpdatePropertyValue ();
static void update_property_value (EventObject *sender, gpointer
calldata, gpointer data);
+ void ResetPropertyValue ();
+ static void reset_property_value (EventObject *sender, gpointer
calldata, gpointer data);
+
AnimationClock *clock;
Animation/*Timeline*/* timeline;
DependencyObject *targetobj;
@@ -150,7 +152,6 @@
void HookupStorage (DependencyObject *targetobj, DependencyProperty
*targetprop);
- virtual void Stop ();
private:
Animation/*Timeline*/ *timeline;
AnimationStorage *storage;
Modified: trunk/moon/src/clock.cpp
===================================================================
--- trunk/moon/src/clock.cpp 2007-10-18 19:48:16 UTC (rev 87792)
+++ trunk/moon/src/clock.cpp 2007-10-18 19:48:54 UTC (rev 87793)
@@ -490,19 +490,6 @@
new_time += our_delta;
}
- /* if we were filling and ended up back in our Active period,
- switch our state and return. */
- if (current_state == Clock::Filling) {
- if (natural_duration.HasTimeSpan ())
- current_progress = new_progress = (double)new_time /
natural_duration.GetTimeSpan();
- else
- current_progress = new_progress = 0.0;
-
- new_state = Clock::Active;
- QueueEvent (CURRENT_STATE_INVALIDATED |
CURRENT_TIME_INVALIDATED);
- }
-
-
#if CLOCK_DEBUG
printf ("Clock %p updated to time %lld\n", this, new_time);
#endif
Modified: trunk/moon/src/dependencyobject.h
===================================================================
--- trunk/moon/src/dependencyobject.h 2007-10-18 19:48:16 UTC (rev 87792)
+++ trunk/moon/src/dependencyobject.h 2007-10-18 19:48:54 UTC (rev 87793)
@@ -185,7 +185,7 @@
//
- // OnCollectionPropertyChanged:
+ // OnCollectionChanged:
//
virtual void OnCollectionChanged (Collection *col, CollectionChangeType
type, DependencyObject *obj, DependencyProperty *prop) { }
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches