Einzelnen Beitrag anzeigen

kaju74

Registriert seit: 22. Okt 2003
185 Beiträge
 
#10

AW: Firemonkey: Animationen in Frames?

  Alt 10. Apr 2015, 12:32
Also, das scheint irgendwie an der ColorKey-Animation zu liegen. Mit der Color-Animation geht's...

Das Problem scheint hier zu liegen:
Delphi-Quellcode:
procedure TColorKeyAnimation.ProcessAnimation;
var
  T: TRttiType;
  P: TRttiProperty;
  Key1, Key2: TKey;
begin
  if FInstance <> nil then
  begin
    if FKeys.FindKeys(NormalizedTime, Key1, Key2) then
    begin
      if (TFloatKey(Key2).Key - TFloatKey(Key1).Key) = 0 then
        Exit;
      T := SharedContext.GetType(FInstance.ClassInfo);
      if T <> nil then
      begin
        P := T.GetProperty(FPath);
        if (P <> nil) and P.PropertyType.IsOrdinal then
          P.SetValue(FInstance,
            InterpolateColor(TColorKey(Key1).Value, TColorKey(Key2).Value,
              (NormalizedTime - TFloatKey(Key1).Key) / (TFloatKey(Key2).Key - TFloatKey(Key1).Key)));
      end;
    end;
  end;
end;
Die Zeile:

if (TFloatKey(Key2).Key - TFloatKey(Key1).Key) = 0 then verhält sich in einer Form anders als in einem Frame. In einem Frame sind beide Werte = 0, sodaß mit "Exit" aus der Methode gesprungen wird. Bei einer Form nicht. Hier ist der erste Wert = 1 und der zweite = 0.

???

Gruß,
Marc

Geändert von kaju74 (10. Apr 2015 um 12:47 Uhr)
  Mit Zitat antworten Zitat