Posted June 19, 20232 yr Добрый день, делаю форму с возможностью масштабирования и рисованием пальцем на TfgPaintbox и наткнулся на такой интересный баг: Если в событии OnPaint вызвать ACanvas.DrawLines то кроме линии на самих точках всегда рисуется точка в координатах [0,0]. Скорее всего это общая проблема для всех TfgCanvas. Прикрепляю демку с проблемой. 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
June 21, 20232 yr 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.
June 21, 20232 yr 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 Edited June 21, 20232 yr by yuri