diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/fpgfx.pas | 73 | ||||
-rw-r--r-- | src/corelib/gdi/gfx_gdi.pas | 41 | ||||
-rw-r--r-- | src/corelib/gfxbase.pas | 24 | ||||
-rw-r--r-- | src/corelib/x11/gfx_x11.pas | 31 | ||||
-rw-r--r-- | src/gui/gui_button.pas | 6 | ||||
-rw-r--r-- | src/gui/gui_combobox.pas | 5 | ||||
-rw-r--r-- | src/gui/gui_edit.pas | 5 | ||||
-rw-r--r-- | src/gui/gui_listbox.pas | 5 | ||||
-rw-r--r-- | src/gui/gui_scrollbar.pas | 4 |
9 files changed, 98 insertions, 96 deletions
diff --git a/src/corelib/fpgfx.pas b/src/corelib/fpgfx.pas index 5d75ffad..a9dddf07 100644 --- a/src/corelib/fpgfx.pas +++ b/src/corelib/fpgfx.pas @@ -153,10 +153,10 @@ type MenuDisabledFont: TfpgFont; public constructor Create; virtual; - procedure DrawButtonFace(ACanvas: TfpgCanvas; x1, y1, x2, y2: TfpgCoord; AFlags: TFButtonFlags); virtual; - procedure DrawControlFrame(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord); virtual; - procedure DrawDirectionArrow(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; direction: integer); virtual; - procedure DrawString(ACanvas: TfpgCanvas; x, y: TfpgCoord; AText: string; AEnabled: boolean = True); virtual; + procedure DrawButtonFace(ACanvas: TfpgCanvas; x, y, w, h: integer; AFlags: TFButtonFlags); virtual; + procedure DrawControlFrame(ACanvas: TfpgCanvas; x, y, w, h: integer); virtual; + procedure DrawDirectionArrow(ACanvas: TfpgCanvas; x, y, w, h: integer; direction: integer); virtual; + procedure DrawString(ACanvas: TfpgCanvas; x, y: integer; AText: string; AEnabled: boolean = True); virtual; end; @@ -713,7 +713,7 @@ end; procedure TfpgCanvas.DrawButtonFace(x, y, w, h: TfpgCoord; AFlags: TFButtonFlags); begin - fpgStyle.DrawButtonFace(self, x, y, x+w-1, y+h-1, AFlags); + fpgStyle.DrawButtonFace(self, x, y, w, h, AFlags); end; procedure TfpgCanvas.DrawControlFrame(x, y, w, h: TfpgCoord); @@ -824,25 +824,25 @@ begin MenuDisabledFont := fpgGetFont(fpgGetNamedFontDesc('MenuDisabled')); end; -procedure TfpgStyle.DrawButtonFace(ACanvas: TfpgCanvas; x1, y1, x2, y2: TfpgCoord; AFlags: TFButtonFlags); +procedure TfpgStyle.DrawButtonFace(ACanvas: TfpgCanvas; x, y, w, h: integer; AFlags: TFButtonFlags); var r: TRect; begin if btnIsDefault in AFlags then begin - r := Rect(x1, y1, x2, y2); + r := Rect(x, y, x+w+1, y+h+1); ACanvas.SetColor(clBlack); ACanvas.SetLineStyle(1, lsSolid); ACanvas.DrawRectangle(r); InflateRect(r, -1, -1); Exclude(AFlags, btnIsDefault); - fpgStyle.DrawButtonFace(ACanvas, r.Left, r.Top, r.Right, r.Bottom, AFlags); + fpgStyle.DrawButtonFace(ACanvas, r.Left, r.Top, r.Right-r.Left-1, r.Bottom-r.Top-1, AFlags); Exit; //==> end; ACanvas.SetColor(clButtonFace); ACanvas.SetLineStyle(1, lsSolid); - ACanvas.FillRectangle(x1, y1, x2, y2); + ACanvas.FillRectangle(x, y, w, h); // Left and Top (outer) if (btnIsPressed in AFlags) then @@ -854,8 +854,8 @@ begin end else ACanvas.SetColor(clHilite1); - ACanvas.DrawLine(x1, y2-1, x1, y1); // left - ACanvas.DrawLine(x1, y1, x2-1, y1); // top + ACanvas.DrawLine(x, y+h-1, x, y); // left + ACanvas.DrawLine(x, y, x+w, y); // top // Left and Top (inner) //if btnIsPressed in AFlags then @@ -875,8 +875,8 @@ begin end else ACanvas.SetColor(clShadow2); - ACanvas.DrawLine(x2, y1, x2, y2); // right - ACanvas.DrawLine(x2, y2, x1, y2); // bottom + ACanvas.DrawLine(x+w, y, x+w, y+h); // right + ACanvas.DrawLine(x+w, y+h, x-1, y+h); // bottom // Right and Bottom (inner) if btnIsPressed in AFlags then @@ -888,44 +888,37 @@ begin end else ACanvas.SetColor(clShadow1); - ACanvas.DrawLine(x2-1, y1+1, x2-1, y2-1); // right - ACanvas.DrawLine(x2-1, y2-1, x1+1, y2-1); // bottom + ACanvas.DrawLine(x+w-1, y+1, x+w-1, y+h-1); // right + ACanvas.DrawLine(x+w-1, y+h-1, x, y+h-1); // bottom end; -procedure TfpgStyle.DrawControlFrame(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord); -var - x2: TfpgCoord; - y2: TfpgCoord; +procedure TfpgStyle.DrawControlFrame(ACanvas: TfpgCanvas; x, y, w, h: integer); begin - // outer bottom right coordinates - x2 := x+w-1; - y2 := y+h-1; - ACanvas.SetColor(clShadow1); - ACanvas.DrawLine(x, y2, x, y); // left (outer) - ACanvas.DrawLine(x, y, x2-1, y); // top (outer) + ACanvas.DrawLine(x, y+h, x, y); // left (outer) + ACanvas.DrawLine(x, y, x+w, y); // top (outer) + + ACanvas.SetColor(clHilite2); + ACanvas.DrawLine(x+w, y, x+w, y+h); // right (outer) + ACanvas.DrawLine(x+w, y+h, x, y+h); // bottom (outer) ACanvas.SetColor(clShadow2); - ACanvas.DrawLine(x+1, y+1, x2-1, y+1); // top (inner) - ACanvas.DrawLine(x+1, y2-1, x+1, y+1); // left (inner) + ACanvas.DrawLine(x+1, y+h-1, x+1, y+1); // left (inner) + ACanvas.DrawLine(x+1, y+1, x+w-1, y+1); // top (inner) ACanvas.SetColor(clHilite1); - ACanvas.DrawLine(x+2, y2-1, x2-1, y2-1); // bottom (inner) - ACanvas.DrawLine(x2-1, y+1, x2-1, y2-1); // right (inner) - - ACanvas.SetColor(clHilite2); - ACanvas.DrawLine(x+1, y2, x2, y2); // bottom (outer) - ACanvas.DrawLine(x2, y, x2, y2); // right (outer) + ACanvas.DrawLine(x+w-1, y+1, x+w-1, y+h-1); // right (inner) + ACanvas.DrawLine(x+w-1, y+h-1, x+1, y+h-1); // bottom (inner) end; -procedure TfpgStyle.DrawDirectionArrow(ACanvas: TfpgCanvas; x, y, w, h: TfpgCoord; direction: integer); +procedure TfpgStyle.DrawDirectionArrow(ACanvas: TfpgCanvas; x, y, w, h: integer; direction: integer); var - peekx: TfpgCoord; - peeky: TfpgCoord; - basex: TfpgCoord; - basey: TfpgCoord; - side: TfpgCoord; - margin: TfpgCoord; + peekx: integer; + peeky: integer; + basex: integer; + basey: integer; + side: integer; + margin: integer; begin ACanvas.SetColor(clText1); side := (w div 4) + 1; diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas index 1ed1284b..d0fc1e95 100644 --- a/src/corelib/gdi/gfx_gdi.pas +++ b/src/corelib/gdi/gfx_gdi.pas @@ -91,11 +91,11 @@ type procedure DoSetColor(cl: TfpgColor); override; procedure DoSetLineStyle(awidth: integer; astyle: TfpgLineStyle); override; procedure DoGetWinRect(out r: TRect); override; - procedure DoFillRectangle(x1, y1, x2, y2: TfpgCoord); override; + procedure DoFillRectangle(x, y, w, h: integer); override; procedure DoXORFillRectangle(col: TfpgColor; x, y, w, h: TfpgCoord); override; procedure DoFillTriangle(x1, y1, x2, y2, x3, y3: TfpgCoord); override; - procedure DoDrawRectangle(x1, y1, x2, y2: TfpgCoord); override; - procedure DoDrawLine(x1, y1, x2, y2: TfpgCoord); override; + procedure DoDrawRectangle(x, y, w, h: integer); override; + procedure DoDrawLine(x1, y1, x2, y2: integer); override; procedure DoDrawImagePart(x, y: TfpgCoord; img: TfpgImageBase; xi, yi, w, h: integer); override; procedure DoDrawString(x, y: TfpgCoord; const txt: string); override; procedure DoSetClipRect(const ARect: TRect); override; @@ -1227,27 +1227,26 @@ begin FClipRectSet := False; end; -procedure TfpgCanvasImpl.DoDrawLine(x1, y1, x2, y2: TfpgCoord); -var - pts: array[1..2] of TPoint; +procedure TfpgCanvasImpl.DoDrawLine(x1, y1, x2, y2: integer); begin - pts[1].X := x1; - pts[1].Y := y1; - pts[2].X := x2; - pts[2].Y := y2; - Windows.Polygon(Fgc, pts, 2); + Windows.MoveToEx(Fgc, x1, y1, nil); + Windows.LineTo(Fgc, x2, y2); end; -procedure TfpgCanvasImpl.DoDrawRectangle(x1, y1, x2, y2: TfpgCoord); +procedure TfpgCanvasImpl.DoDrawRectangle(x, y, w, h: integer); var - pts: array[1..5] of TPoint; + r: TRect; begin - pts[1].X := x1; pts[1].Y := y1; - pts[2].X := x2; pts[2].Y := y1; - pts[3].X := x2; pts[3].Y := y2; - pts[4].X := x1; pts[4].Y := y2; - pts[5].X := x1; pts[5].Y := y1; - Windows.Polyline(Fgc, pts, 5); + if (w = 1) and (h = 1) then + SetPixel(x, y, FColor) + else + begin + r := Rect(x, y, x+w-1, y+h-1); + DoDrawLine(r.Left, r.Top, r.Right, r.Top); + DoDrawLine(r.Right, r.Top, r.Right, r.Bottom); + DoDrawLine(r.Right, r.Bottom, r.Left, r.Bottom); + DoDrawLine(r.Left, r.Bottom, r.Left, r.Top); + end; end; procedure TfpgCanvasImpl.DoDrawString(x, y: TfpgCoord; const txt: string); @@ -1265,11 +1264,11 @@ begin {$endif} end; -procedure TfpgCanvasImpl.DoFillRectangle(x1, y1, x2, y2: TfpgCoord); +procedure TfpgCanvasImpl.DoFillRectangle(x, y, w, h: integer); var r: TRect; begin - r := Rect(x1, y1, x2+1, y2+1); + r := Rect(x, y, x+w, y+h); Windows.FillRect(Fgc, r, FBrush); end; diff --git a/src/corelib/gfxbase.pas b/src/corelib/gfxbase.pas index 6c0ace9b..b3f4d672 100644 --- a/src/corelib/gfxbase.pas +++ b/src/corelib/gfxbase.pas @@ -236,11 +236,11 @@ type procedure DoSetColor(cl: TfpgColor); virtual; abstract; procedure DoSetLineStyle(awidth: integer; astyle: TfpgLineStyle); virtual; abstract; procedure DoGetWinRect(out r: TRect); virtual; abstract; - procedure DoFillRectangle(x1, y1, x2, y2: TfpgCoord); virtual; abstract; + procedure DoFillRectangle(x, y, w, h: integer); virtual; abstract; procedure DoXORFillRectangle(col: TfpgColor; x, y, w, h: TfpgCoord); virtual; abstract; procedure DoFillTriangle(x1, y1, x2, y2, x3, y3: TfpgCoord); virtual; abstract; - procedure DoDrawRectangle(x1, y1, x2, y2: TfpgCoord); virtual; abstract; - procedure DoDrawLine(x1, y1, x2, y2: TfpgCoord); virtual; abstract; + procedure DoDrawRectangle(x, y, w, h: integer); virtual; abstract; + procedure DoDrawLine(x1, y1, x2, y2: integer); virtual; abstract; procedure DoDrawImagePart(x, y: TfpgCoord; img: TfpgImageBase; xi, yi, w, h: integer); virtual; abstract; procedure DoDrawString(x, y: TfpgCoord; const txt: string); virtual; abstract; procedure DoSetClipRect(const ARect: TRect); virtual; abstract; @@ -257,7 +257,7 @@ type public constructor Create; virtual; destructor Destroy; override; - procedure DrawRectangle(x1, y1, x2, y2: TfpgCoord); overload; + procedure DrawRectangle(x, y, w, h: integer); overload; procedure DrawRectangle(r: TRect); overload; procedure DrawLine(x1, y1, x2, y2: TfpgCoord); procedure DrawImage(x, y: TfpgCoord; img: TfpgImageBase); @@ -266,7 +266,7 @@ type procedure StretchDraw (x, y, w, h: TfpgCoord; ASource: TfpgImageBase); procedure CopyRect(x, y: TfpgCoord; ACanvas: TfpgCanvasBase; var SourceRect: TRect); procedure DrawString(x, y: TfpgCoord; const txt: string); - procedure FillRectangle(x1, y1, x2, y2: TfpgCoord); overload; + procedure FillRectangle(x, y, w, h: integer); overload; procedure FillRectangle(r: TRect); overload; procedure FillTriangle(x1, y1, x2, y2, x3, y3: TfpgCoord); procedure FillArc(x, y, w, h: TfpgCoord; a1, a2: double); @@ -730,14 +730,15 @@ begin inherited Destroy; end; -procedure TfpgCanvasBase.DrawRectangle(x1, y1, x2, y2: TfpgCoord); +procedure TfpgCanvasBase.DrawRectangle(x, y, w, h: integer); begin - DoDrawRectangle(x1, y1, x2, y2); + DoDrawRectangle(x, y, w, h); end; procedure TfpgCanvasBase.DrawRectangle(r: TRect); begin - DoDrawRectangle(r.Left, r.Top, r.Right, r.Bottom); + SortRect(r); + DoDrawRectangle(r.Left, r.Top, r.Right-r.Left, r.Bottom-r.Top); end; procedure TfpgCanvasBase.DrawLine(x1, y1, x2, y2: TfpgCoord); @@ -822,14 +823,15 @@ begin end; end; -procedure TfpgCanvasBase.FillRectangle(x1, y1, x2, y2: TfpgCoord); +procedure TfpgCanvasBase.FillRectangle(x, y, w, h: integer); begin - DoFillRectangle(x1, y1, x2, y2); + DoFillRectangle(x, y, w, h); end; procedure TfpgCanvasBase.FillRectangle(r: TRect); begin - DoFillRectangle(r.Left, r.Top, r.Right, r.Bottom); + SortRect(r); + DoFillRectangle(r.Left, r.Top, r.Right-r.Left, r.Bottom-r.Top); end; procedure TfpgCanvasBase.FillTriangle(x1, y1, x2, y2, x3, y3: TfpgCoord); diff --git a/src/corelib/x11/gfx_x11.pas b/src/corelib/x11/gfx_x11.pas index fce95e78..f41ce904 100644 --- a/src/corelib/x11/gfx_x11.pas +++ b/src/corelib/x11/gfx_x11.pas @@ -100,11 +100,11 @@ type procedure DoSetColor(cl: TfpgColor); override; procedure DoSetLineStyle(awidth: integer; astyle: TfpgLineStyle); override; procedure DoGetWinRect(out r: TRect); override; - procedure DoFillRectangle(x1, y1, x2, y2: TfpgCoord); override; + procedure DoFillRectangle(x, y, w, h: integer); override; procedure DoXORFillRectangle(col: TfpgColor; x, y, w, h: TfpgCoord); override; procedure DoFillTriangle(x1, y1, x2, y2, x3, y3: TfpgCoord); override; - procedure DoDrawRectangle(x1, y1, x2, y2: TfpgCoord); override; - procedure DoDrawLine(x1, y1, x2, y2: TfpgCoord); override; + procedure DoDrawRectangle(x, y, w, h: integer); override; + procedure DoDrawLine(x1, y1, x2, y2: integer); override; procedure DoDrawImagePart(x, y: TfpgCoord; img: TfpgImageBase; xi, yi, w, h: integer); override; procedure DoDrawString(x, y: TfpgCoord; const txt: string); override; procedure DoSetClipRect(const ARect: TRect); override; @@ -1264,6 +1264,8 @@ begin end; Fgc := XCreateGc(xapplication.display, FDrawHandle, 0, @GcValues); + // CapNotLast is so we get the same behavior as Windows. See documentation for more details. + XSetLineAttributes(xapplication.display, Fgc, 0, LineSolid, CapNotLast, JoinMiter); FXftDraw := XftDrawCreate(xapplication.display, FDrawHandle, XDefaultVisual(xapplication.display, xapplication.DefaultScreen), @@ -1380,30 +1382,30 @@ begin lsDot: begin XSetLineAttributes(xapplication.display, Fgc, 0, - LineOnOffDash, CapButt, JoinMiter); + LineOnOffDash, CapNotLast, JoinMiter); XSetDashes(xapplication.display, Fgc, 0, cDot, 2); end; lsDash: begin XSetLineAttributes(xapplication.display, Fgc, 0, - LineOnOffDash, CapButt, JoinMiter); + LineOnOffDash, CapNotLast, JoinMiter); XSetDashes(xapplication.display, Fgc, 0, cDash, 2); end; lsDashDot: begin XSetLineAttributes(xapplication.display, Fgc, 0, - LineOnOffDash, CapButt, JoinMiter); + LineOnOffDash, CapNotLast, JoinMiter); XSetDashes(xapplication.display, Fgc, 0, cDashDot, 4); end; lsDashDotDot: begin XSetLineAttributes(xapplication.display, Fgc, 0, - LineOnOffDash, CapButt, JoinMiter); + LineOnOffDash, CapNotLast, JoinMiter); XSetDashes(xapplication.display, Fgc, 0, cDashDotDot, 6); end; else // which includes lsSolid XSetLineAttributes(xapplication.display, Fgc, 0, - LineSolid, CapButt, JoinMiter); + LineSolid, CapNotLast, JoinMiter); end; { case } end; @@ -1434,9 +1436,9 @@ begin r.Bottom := h; end; -procedure TfpgCanvasImpl.DoFillRectangle(x1, y1, x2, y2: TfpgCoord); +procedure TfpgCanvasImpl.DoFillRectangle(x, y, w, h: integer); begin - XFillRectangle(xapplication.display, FDrawHandle, Fgc, x1, y1, x2-x1+1, y2-y1+1); + XFillRectangle(xapplication.display, FDrawHandle, Fgc, x, y, w, h); end; procedure TfpgCanvasImpl.DoXORFillRectangle(col: TfpgColor; x, y, w, h: TfpgCoord); @@ -1462,13 +1464,16 @@ begin XFillPolygon(xapplication.display, FDrawHandle, Fgc, @pts, 3, 0, 0); end; -procedure TfpgCanvasImpl.DoDrawRectangle(x1, y1, x2, y2: TfpgCoord); +procedure TfpgCanvasImpl.DoDrawRectangle(x, y, w, h: integer); begin - XDrawRectangle(xapplication.display, FDrawHandle, Fgc, x1, y1, x2-x1, y2-y1); +// writeln(Format('DoDrawRectangle x=%d y=%d w=%d h=%d', [x, y, w, h])); + // Same behavior as Windows. See documentation for reason. + XDrawRectangle(xapplication.display, FDrawHandle, Fgc, x, y, w-1, h-1); end; -procedure TfpgCanvasImpl.DoDrawLine(x1, y1, x2, y2: TfpgCoord); +procedure TfpgCanvasImpl.DoDrawLine(x1, y1, x2, y2: integer); begin + // Same behavior as Windows. See documentation for reason. XDrawLine(xapplication.display, FDrawHandle, Fgc, x1, y1, x2, y2); end; diff --git a/src/gui/gui_button.pas b/src/gui/gui_button.pas index d3e84b80..3344880c 100644 --- a/src/gui/gui_button.pas +++ b/src/gui/gui_button.pas @@ -203,13 +203,13 @@ begin if FEmbedded then Include(lBtnFlags, btnIsEmbedded); - Canvas.DrawButtonFace(0, 0, Width, Height, lBtnFlags); + Canvas.DrawButtonFace(0, 0, Width-1, Height-1, lBtnFlags); if FFocused and (not FEmbedded) then begin Canvas.SetColor(clText1); Canvas.SetLineStyle(1, lsDot); - InflateRect(r, -3, -3); + InflateRect(r, -2, -2); Canvas.DrawRectangle(r); end else @@ -222,7 +222,7 @@ begin Canvas.SetFont(Font); AText := FText; - y := Height div 2 - FFont.Height div 2; + y := Height div 2 - FFont.Height div 2; if y < 3 then y := 3; diff --git a/src/gui/gui_combobox.pas b/src/gui/gui_combobox.pas index 3d13e6ae..8b3684b9 100644 --- a/src/gui/gui_combobox.pas +++ b/src/gui/gui_combobox.pas @@ -268,7 +268,7 @@ begin // inherited HandlePaint; Canvas.ClearClipRect; r := Rect(0, 0, Width-1, Height-1); - Canvas.DrawControlFrame(0, 0, Width, Height); + Canvas.DrawControlFrame(0, 0, Width-1, Height-1); // internal background rectangle (without frame) InflateRect(r, -2, -2); @@ -278,7 +278,8 @@ begin Canvas.SetColor(FBackgroundColor) else Canvas.SetColor(clWindowBackground); - Canvas.FillRectangle(r); + Canvas.FillRectangle(r.Left, r.Top, Width-4, Height-4); +// Canvas.FillRectangle(r); // fpgStyle.DrawButtonFace(canvas, width - min(height, 20)-3, 2, height-4, height-4, [btnIsEmbedded]); // fpgStyle.DrawDirectionArrow(canvas, width - height + 1, 1, height-2, height-2, 1); diff --git a/src/gui/gui_edit.pas b/src/gui/gui_edit.pas index c6820a5e..998ac2aa 100644 --- a/src/gui/gui_edit.pas +++ b/src/gui/gui_edit.pas @@ -208,7 +208,7 @@ begin Canvas.BeginDraw; Canvas.ClearClipRect; r := Rect(0, 0, Width-1, Height-1); - Canvas.DrawControlFrame(0, 0, Width, Height); + Canvas.DrawControlFrame(0, 0, Width-1, Height-1); InflateRect(r, -2, -2); Canvas.SetClipRect(r); @@ -217,7 +217,8 @@ begin Canvas.SetColor(FBackgroundColor) else Canvas.SetColor(clWindowBackground); - Canvas.FillRectAngle(r); + Canvas.FillRectangle(r.Left, r.Top, Width-4, Height-4); +// Canvas.FillRectAngle(r); dtext := GetDrawText; Canvas.SetTextColor(clText1); diff --git a/src/gui/gui_listbox.pas b/src/gui/gui_listbox.pas index 53b54967..f6ae0339 100644 --- a/src/gui/gui_listbox.pas +++ b/src/gui/gui_listbox.pas @@ -468,13 +468,14 @@ begin end else begin - Canvas.DrawControlFrame(0, 0, Width, Height); + Canvas.DrawControlFrame(0, 0, Width-1, Height-1); InflateRect(r, -2, -2); end; Canvas.SetClipRect(r); Canvas.SetColor(FBackgroundColor); - Canvas.FillRectangle(r); + Canvas.FillRectangle(r.Left, r.Top, Width-4, Height-4); +// Canvas.FillRectangle(r); Canvas.SetFont(FFont); r := Rect(FMargin, FMargin, (Width-1)-ScrollBarWidth-FMargin, (Height-1)-FMargin); diff --git a/src/gui/gui_scrollbar.pas b/src/gui/gui_scrollbar.pas index e95d3a2f..8eac0905 100644 --- a/src/gui/gui_scrollbar.pas +++ b/src/gui/gui_scrollbar.pas @@ -191,12 +191,12 @@ begin if Orientation = orVertical then begin - Canvas.FillRectangle(0, Width, Width-1, Height-1 - Width); + Canvas.FillRectangle(0, Width-1, Width-2, Height-2 - Width-1); area := Height - (Width shl 1); end else begin - Canvas.FillRectangle(Height, 0, Width - Height-1, Height); + Canvas.FillRectangle(Height, 0, Width - Height-3, Height); area := Width - (Height shl 1); end; |