mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 00:19:26 +02:00
fpvectorial: Fix scaling of pen width in wmf format.
This commit is contained in:
parent
14de8d531d
commit
0da912bd84
@ -3911,11 +3911,13 @@ end;
|
|||||||
procedure TvEntityWithPen.ApplyPenToCanvas(constref ARenderInfo: TvRenderInfo; APen: TvPen);
|
procedure TvEntityWithPen.ApplyPenToCanvas(constref ARenderInfo: TvRenderInfo; APen: TvPen);
|
||||||
var
|
var
|
||||||
ADest: TFPCustomCanvas absolute ARenderInfo.Canvas;
|
ADest: TFPCustomCanvas absolute ARenderInfo.Canvas;
|
||||||
|
AMulX: Double absolute ARenderInfo.MulX;
|
||||||
|
AMulY: Double absolute ARenderInfo.MulY;
|
||||||
begin
|
begin
|
||||||
if ADest = nil then
|
if ADest = nil then
|
||||||
exit;
|
exit;
|
||||||
ADest.Pen.FPColor := AdjustColorToBackground(APen.Color, ARenderInfo);
|
ADest.Pen.FPColor := AdjustColorToBackground(APen.Color, ARenderInfo);
|
||||||
ADest.Pen.Width := Max(1, APen.Width); // wp: why was here "1;//APen.Width;" ???
|
ADest.Pen.Width := Max(1, FPVSizeToCanvas(APen.Width, Max(AMulX, abs(AMulY))));
|
||||||
ADest.Pen.Style := APen.Style;
|
ADest.Pen.Style := APen.Style;
|
||||||
{$ifdef USE_LCL_CANVAS}
|
{$ifdef USE_LCL_CANVAS}
|
||||||
if (APen.Style = psPattern) then
|
if (APen.Style = psPattern) then
|
||||||
|
@ -49,6 +49,7 @@ function CanvasCoordsToFPVectorial(AY: Integer; AHeight: Integer): Integer; inli
|
|||||||
function CanvasTextPosToFPVectorial(AY: Integer; ACanvasHeight, ATextHeight: Integer): Integer;
|
function CanvasTextPosToFPVectorial(AY: Integer; ACanvasHeight, ATextHeight: Integer): Integer;
|
||||||
function CoordToCanvasX(ACoord: Double; ADestX: Integer; AMulX: Double): Integer; inline;
|
function CoordToCanvasX(ACoord: Double; ADestX: Integer; AMulX: Double): Integer; inline;
|
||||||
function CoordToCanvasY(ACoord: Double; ADestY: Integer; AMulY: Double): Integer; inline;
|
function CoordToCanvasY(ACoord: Double; ADestY: Integer; AMulY: Double): Integer; inline;
|
||||||
|
function FPVSizeToCanvas(ASize, AMul: Double): Integer;
|
||||||
// Other routines
|
// Other routines
|
||||||
function SeparateString(AString: string; ASeparator: char): T10Strings;
|
function SeparateString(AString: string; ASeparator: char): T10Strings;
|
||||||
procedure SeparateStringInTwo(AString: string; ASeparator: char; out AStart, AEnd: string);
|
procedure SeparateStringInTwo(AString: string; ASeparator: char; out AStart, AEnd: string);
|
||||||
@ -225,6 +226,11 @@ begin
|
|||||||
Result := Round(ADestY + AmulY * ACoord);
|
Result := Round(ADestY + AmulY * ACoord);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function FPVSizeToCanvas(ASize, AMul: Double): Integer;
|
||||||
|
begin
|
||||||
|
Result := Round(ASize * abs(AMul));
|
||||||
|
end;
|
||||||
|
|
||||||
{@@
|
{@@
|
||||||
Reads a string and separates it in substring
|
Reads a string and separates it in substring
|
||||||
using ASeparator to delimite them.
|
using ASeparator to delimite them.
|
||||||
@ -244,7 +250,7 @@ begin
|
|||||||
for i := 0 to 9 do
|
for i := 0 to 9 do
|
||||||
Result[i] := '';
|
Result[i] := '';
|
||||||
|
|
||||||
{ Iterates througth the string, filling strings }
|
{ Iterates through the string, filling strings }
|
||||||
for i := 1 to Length(AString) do
|
for i := 1 to Length(AString) do
|
||||||
begin
|
begin
|
||||||
if Copy(AString, i, 1) = ASeparator then
|
if Copy(AString, i, 1) = ASeparator then
|
||||||
|
Loading…
Reference in New Issue
Block a user