Einzelnen Beitrag anzeigen

Benutzerbild von rollstuhlfahrer
rollstuhlfahrer

Registriert seit: 1. Aug 2007
Ort: Ludwigshafen am Rhein
1.529 Beiträge
 
Delphi 7 Professional
 
#10

Re: ZUfälliges Panel aufleuchten lassen

  Alt 19. Jan 2008, 22:45
also ich sag mal so:
wenn der Code in Delphi-Tags stünde und/oder ordentlich formatiert wäre, wäre er einfacher zu lesen
das ganze sieht dann so aus.
Delphi-Quellcode:
if y - radius < Leinwand.ClipRect.Top then
begin
  y := Leinwand.ClipRect.Top + radius;
  dy := -dy;
end;

if y + radius >= Leinwand.ClipRect.Bottom then
begin
  y := Leinwand.ClipRect.Bottom - 1 - radius;
  dy := -dy;
end;

if x - radius < Leinwand.ClipRect.Left then
begin
  x := Leinwand.ClipRect.left + radius;
  dx := -dx;
end;

if x + radius >= Leinwand.ClipRect.Right then
begin
  x := Leinwand.ClipRect.right - radius;
  dx := -dx;
end;
Des Weiteren lässt sich nur sagen:
radius, dx: Integer; Auf jeden Fall ne Zahl im pos. und neg. Bereich
Leinwand: TCanvas; bin mir aber nicht ganz sicher

Für weitere Aussagen ist der Code-Schnipsel zu klein

rollstuhlfahrer
Bernhard
  Mit Zitat antworten Zitat