[修复] Firemonkey 使用 DrawPath 断线问题(Android iOS 平台)
生活随笔
收集整理的這篇文章主要介紹了
[修复] Firemonkey 使用 DrawPath 断线问题(Android iOS 平台)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
問題:使用 Canvas.DrawPath 繪制時,最后一點無法畫到終點位置。(這個問題要在粗線才能察覺)
適用:Delphi 10 Seattle (或更早的版本) for Android & iOS
修復方法:
請將源碼 FMX.StrokeBuilder.pas?復制到自己的工程目錄里,再進行修改。
procedure TStrokeBuilder.BuildSolidPolygon(const Points: TPolygon; const Opacity: Single; BreakAtEnd: Boolean);...略...while CurIndex < Length(Points) dobeginif (CurIndex >= Length(Points) - 1) and BreakAtEnd and (Points[0] <> Points[Length(Points) - 1]) then {--->刪除這行 Break;} {+++>新增代碼}// 修復曲線最后一點斷線的問題 by Aone (2016/03/25)beginPieceDirVec := (DestPos - SrcPos).Normalize;ThickPerp := TPointF.Create(-PieceDirVec.Y, PieceDirVec.X) * FHalfThickness;InsertVertex(DestPos - ThickPerp, FStrokeColor);InsertVertex(DestPos + ThickPerp, FStrokeColor);if PrevVerticesPlaced thenbeginInsertIndex(FCurrentVertex - 3);InsertIndex(FCurrentVertex - 1);InsertIndex(FCurrentVertex - 2);InsertIndex(FCurrentVertex - 2);InsertIndex(FCurrentVertex - 4);InsertIndex(FCurrentVertex - 3);end;Break;end; {<+++}...略...end;效果:
?
官方有人提交 QC 了:?
RSP-14309: [iOS & Android] Delphi 10.1 Berlin - drawing problems
https://quality.embarcadero.com/browse/RSP-14309
?
轉載于:https://www.cnblogs.com/onechen/p/5319631.html
總結
以上是生活随笔為你收集整理的[修复] Firemonkey 使用 DrawPath 断线问题(Android iOS 平台)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: angluar.js 学习
- 下一篇: Leetcode 142 Linked