From 6912daab751789ccf29ba28a1044e11acd277472 Mon Sep 17 00:00:00 2001 From: graemeg Date: Wed, 18 Jul 2007 13:42:21 +0000 Subject: * Minor fixes with line and rectangle drawing. --- prototypes/fpgui2/examples/core/canvastest/fpgcanvas.lpi | 8 +++----- prototypes/fpgui2/examples/core/canvastest/fpgcanvas.lpr | 14 ++++++++++++++ prototypes/fpgui2/source/core/fpgfx.pas | 2 +- prototypes/fpgui2/source/core/x11/gfx_x11.pas | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) (limited to 'prototypes/fpgui2') diff --git a/prototypes/fpgui2/examples/core/canvastest/fpgcanvas.lpi b/prototypes/fpgui2/examples/core/canvastest/fpgcanvas.lpi index c85685b5..9c070422 100644 --- a/prototypes/fpgui2/examples/core/canvastest/fpgcanvas.lpi +++ b/prototypes/fpgui2/examples/core/canvastest/fpgcanvas.lpi @@ -1,7 +1,7 @@ - + @@ -9,7 +9,7 @@ - + </General> @@ -18,14 +18,13 @@ </VersionInfo> <PublishOptions> <Version Value="2"/> - <DestinationDirectory Value="$(TestDir)\publishedproject\"/> <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> </PublishOptions> <RunParams> <local> <FormatVersion Value="1"/> - <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> </local> </RunParams> <RequiredPackages Count="1"> @@ -43,7 +42,6 @@ </ProjectOptions> <CompilerOptions> <Version Value="5"/> - <PathDelim Value="\"/> <CodeGeneration> <Generate Value="Faster"/> </CodeGeneration> diff --git a/prototypes/fpgui2/examples/core/canvastest/fpgcanvas.lpr b/prototypes/fpgui2/examples/core/canvastest/fpgcanvas.lpr index 0f6b560f..4e3b0944 100644 --- a/prototypes/fpgui2/examples/core/canvastest/fpgcanvas.lpr +++ b/prototypes/fpgui2/examples/core/canvastest/fpgcanvas.lpr @@ -129,6 +129,20 @@ begin Canvas.DrawImage(150, 300, dst); Canvas.StretchDraw(180, 300, 70, 70, dst); Canvas.StretchDraw(265, 300, 230, 25, bmp); + + + // testing accuracy of line/rectangle drawing + Canvas.SetColor(clBlack); + Canvas.SetLineStyle(1, lsSolid); + r.Top := 302; + r.Left := 182; + r.Width := 66; + r.Height := 66; + Canvas.DrawRectangle(r); + + Canvas.SetColor(clBlue); + Canvas.DrawLine(183, 303, 247, 303); + // Stretch(bmp, dst, ResampleFilters[6].Filter, ResampleFilters[6].Width); //// Canvas.DrawImage(150, 240, bmp); diff --git a/prototypes/fpgui2/source/core/fpgfx.pas b/prototypes/fpgui2/source/core/fpgfx.pas index e62e0c3f..fce957ce 100644 --- a/prototypes/fpgui2/source/core/fpgfx.pas +++ b/prototypes/fpgui2/source/core/fpgfx.pas @@ -768,7 +768,7 @@ begin end else ACanvas.SetColor(clHilite1); - ACanvas.DrawLine(x, y+h, x, y); // left + ACanvas.DrawLine(x, y+h-1, x, y); // left ACanvas.DrawLine(x, y, x+w, y); // top // Left and Top (inner) diff --git a/prototypes/fpgui2/source/core/x11/gfx_x11.pas b/prototypes/fpgui2/source/core/x11/gfx_x11.pas index 25dc7278..7f0a02eb 100644 --- a/prototypes/fpgui2/source/core/x11/gfx_x11.pas +++ b/prototypes/fpgui2/source/core/x11/gfx_x11.pas @@ -1375,7 +1375,7 @@ end; procedure TfpgCanvasImpl.DoDrawRectangle(x, y, w, h: TfpgCoord); begin - XDrawRectangle(xapplication.display, FDrawHandle, Fgc, x, y, w - 1, h - 1); + XDrawRectangle(xapplication.display, FDrawHandle, Fgc, x, y, w-1, h-1); end; procedure TfpgCanvasImpl.DoDrawLine(x1, y1, x2, y2: TfpgCoord); -- cgit v1.2.3-70-g09d2