Jump to content
View in the app

A better way to browse. Learn more.

FGX Native

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Добрый день,

делаю форму с возможностью масштабирования и рисованием пальцем на TfgPaintbox и наткнулся на такой интересный баг:

Если в событии OnPaint вызвать ACanvas.DrawLines то кроме линии на самих точках всегда рисуется точка в координатах [0,0].

Скорее всего это общая проблема для всех TfgCanvas.

image.thumb.png.adacb6d121f04c68521733dd598e1006.png

Прикрепляю демку с проблемой.

Spoiler
procedure TFormMain.pbSourcePaint(Sender: TObject; const ACanvas: TfgCanvas);
begin
  var vPoints : TfgPoints;

  try
    SetLength(vPoints, 2);

    vPoints[0].SetLocation(150, 150);
    vPoints[1].SetLocation(300, 300);

    ACanvas.Stroke.Thickness := 20;

    ACanvas.DrawLines(vPoints);
  finally
    SetLength(vPoints, 0);
  end;
end;

FGX 1.16.0.1, Delphi 11.3. 

LinesDemo.zip

The issue seems to be that SetLength is not doing its job!
When I step through your code    length = 8589934593....

Unfortunately, I don't know why this is happening.

  • Author
3 hours ago, Alan said:

The issue seems to be that SetLength is not doing its job!
When I step through your code    length = 8589934593....

Unfortunately, I don't know why this is happening.

I don't think that you see bug of SetLength, maybe you get bug of debugger, because in real life project i use `for i := 0 to Length(vPoints) - 1` a lot of times and all works fine, but i see same colored pixel[0,0].

Strange issue that applying of ZoomMatrix and TranslationMatrix works with this [0,0] pixel like it's really in vPoints array. So it's definitly somehow related with DrawLines method.

Spoiler

image.thumb.png.9a7bdb82e6bfa6427b30950609ecd55f.png

 

Edited by yuri

Recently Browsing 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.