diff options
author | Erich Eckner <git@eckner.net> | 2020-05-21 00:17:15 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-05-21 00:17:15 +0200 |
commit | f6b497c56081f0c6c8810e0f03deb8c539192a42 (patch) | |
tree | 4a2c39178252c5ba0db4cc619b42fe31d030e9a2 | |
parent | 9c20c00d672817ac259bd0349148b8743d3ddb75 (diff) | |
download | Raetsel-f6b497c56081f0c6c8810e0f03deb8c539192a42.tar.xz |
raetselunit.pas: schöneren Cursor zeichnen
-rw-r--r-- | raetselunit.pas | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/raetselunit.pas b/raetselunit.pas index cbc5f1b..121a9ea 100644 --- a/raetselunit.pas +++ b/raetselunit.pas @@ -776,7 +776,7 @@ end; procedure tFelderRaetsel.zeichnen(cursor: boolean = true); var - i,j: longint; + i,j,k: longint; begin if not (assigned(sudokuCB) and assigned(puzzleCB)) then exit; @@ -826,21 +826,15 @@ begin end; end; zeichenFlaeche.canvas.pen.color:=$8080ff; - zeichenFlaeche.canvas.pen.width:=1; + zeichenFlaeche.canvas.pen.width:=3; if (cursorPosition>=0) and (dim>0) and cursor then begin - zeichenFlaeche.canvas.brush.color:= - $ffffff - $181818 * byte( - diagonalenCB.checked and ( - (cursorPosition mod (dim+1)=0) or - (cursorPosition mod (dim-1)=0) - ) - ); - zeichenFlaeche.canvas.rectangle( - round(((cursorPosition mod dim)+1)*zellGroesze), - round(((cursorPosition div dim)+1)*zellGroesze), - round(((cursorPosition mod dim)+2)*zellGroesze+1), - round(((cursorPosition div dim)+2)*zellGroesze+1) - ); + for i:=0 to 1 do + for j:=0 to 1 do + for k:=0 to 1 do + with zeichenFlaeche.canvas do begin + moveTo(round((i+1+(cursorPosition mod dim))*zellGroesze),round((j+1+(cursorPosition div dim))*zellGroesze)); + lineTo(round((i+1+(cursorPosition mod dim)+(1-2*i)*k/6)*zellGroesze),round((j+1+(cursorPosition div dim)+(1-2*j)*(1-k)/6)*zellGroesze)); + end; end; zeichenFlaeche.canvas.pen.width:=3; zeichenFlaeche.canvas.brush.color:=$ffffff; |