diff --git a/components/lazmapviewer/source/mvdrawingengine.pas b/components/lazmapviewer/source/mvdrawingengine.pas index 3d1fe5e71..4d06cba9d 100644 --- a/components/lazmapviewer/source/mvdrawingengine.pas +++ b/components/lazmapviewer/source/mvdrawingengine.pas @@ -31,6 +31,12 @@ type Color: TColor; end; + TMvPen = record + Style: TPenStyle; + Width: Integer; + Color: TColor; + end; + { TMvCustomDrawingEngine } TMvCustomDrawingEngine = class(TComponent) @@ -69,6 +75,7 @@ type procedure FillPixels(X1, Y1, X2, Y2: Integer; AColor: TColor); virtual; abstract; procedure FillRect(X1, Y1, X2, Y2: Integer); virtual; abstract; function GetFont: TMvFont; + function GetPen: TMvPen; procedure Line(X1, Y1, X2, Y2: Integer); virtual; abstract; procedure Polyline(const Points: array of TPoint); virtual; abstract; procedure Polygon(const Points: array of TPoint); virtual; abstract; @@ -80,6 +87,8 @@ type function SaveToImage(AClass: TRasterImageClass): TRasterImage; virtual; abstract; procedure SetFont(AFont: TMvFont); procedure SetFont(AFontName: String; AFontSize: Integer; AFontStyle: TFontStyles; AFontColor: TColor); + procedure SetPen(APen: TMvPen); + procedure SetPen(APenStyle: TPenStyle; APenWidth: Integer; APenColor: TColor); function TextExtent(const AText: String): TSize; virtual; abstract; function TextHeight(const AText: String): Integer; procedure TextOut(X, Y: Integer; const AText: String); virtual; abstract; @@ -590,6 +599,13 @@ begin Result.Color := FontColor; end; +function TMvCustomDrawingEngine.GetPen: TMvPen; +begin + Result.Style := PenStyle; + Result.Width := PenWidth; + Result.Color := PenColor; +end; + procedure TMvCustomDrawingEngine.PaintToCanvas(ACanvas: TCanvas); begin PaintToCanvas(ACanvas, Point(0, 0)); @@ -609,6 +625,19 @@ begin FontColor := AFontColor; end; +procedure TMvCustomDrawingEngine.SetPen(APen: TMvPen); +begin + SetPen(APen.Style, APen.Width, APen.Color); +end; + +procedure TMvCustomDrawingEngine.SetPen(APenStyle: TPenStyle; + APenWidth: Integer; APenColor: TColor); +begin + PenStyle := APenStyle; + PenWidth := APenWidth; + PenColor := APenColor; +end; + function TMvCustomDrawingEngine.TextHeight(const AText: String): Integer; begin Result := TextExtent(AText).CX; @@ -619,6 +648,5 @@ begin Result := TextExtent(AText).CY; end; - end. diff --git a/components/lazmapviewer/source/mvmapviewer.pas b/components/lazmapviewer/source/mvmapviewer.pas index 4158cf3c4..90abad6d0 100644 --- a/components/lazmapviewer/source/mvmapviewer.pas +++ b/components/lazmapviewer/source/mvmapviewer.pas @@ -27,7 +27,8 @@ interface uses Classes, SysUtils, Types, fgl, FPImage, - Controls, GraphType, Graphics, IntfGraphics, + LazFileUtils, GraphType, + Controls, Graphics, IntfGraphics, Forms, ImgList, LCLVersion, mvTypes, mvGeoMath, mvGPSObj, mvDragObj, mvCache, mvExtraData, mvEngine, mvMapProvider, mvDownloadEngine, mvDrawingEngine; @@ -3253,7 +3254,7 @@ procedure TMapView.DoDrawMissingTile(ATileID: TTileID; ARect: TRect); var lHandled: Boolean; begin - lHandled := PluginManager.DrawMissingTile(Self, DrawingEngine, ATileID, ARect); + lHandled := GetPluginManager.DrawMissingTile(Self, DrawingEngine, ATileID, ARect); if (not lHandled) and Assigned(FOnDrawMissingTile) then FOnDrawMissingTile(Self, DrawingEngine, ATileID, ARect) else @@ -3805,7 +3806,7 @@ begin clProfile: Result := Concat(GetUserDir, LazMVCacheFolder); clTemp: Result := Concat(GetTempDir(True), LazMVCacheFolder); otherwise - Result := ACustomPath; + Result := AppendPathDelim(ACustomPath); end; end;