Skip to content

Commit ba21ce3

Browse files
Ver.1.3.0
Fixed resize if editor content Updated some libraries Support for Windows 11
1 parent 1d6ec48 commit ba21ce3

File tree

168 files changed

+41583
-34200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+41583
-34200
lines changed

Ext/SVGIconImageList/Image32/source/Img32.CQ.pas

Lines changed: 1030 additions & 1031 deletions
Large diffs are not rendered by default.
Lines changed: 180 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -1,180 +1,180 @@
1-
unit Img32.Clipper;
2-
3-
(*******************************************************************************
4-
* Author : Angus Johnson *
5-
* Version : 2.24 *
6-
* Date : 26 June 2021 *
7-
* Website : http://www.angusj.com *
8-
* Copyright : Angus Johnson 2019-2021 *
9-
* Purpose : Wrapper module for the Clipper library *
10-
* License : http://www.boost.org/LICENSE_1_0.txt *
11-
*******************************************************************************)
12-
13-
interface
14-
15-
uses
16-
ClipperCore, Clipper, ClipperOffset,
17-
Img32, Img32.Draw, Img32.Vector;
18-
19-
//nb: InflatePath assumes that there's consistent winding where
20-
//outer paths wind in one direction and inner paths in the other
21-
22-
function InflatePath(const path: TPathD; delta: Double;
23-
joinStyle: TJoinStyle = jsAuto; endStyle: TEndStyle = esPolygon;
24-
miterLimit: double = 2.0; arcTolerance: double = 0.0;
25-
minEdgeLength: double = 0.25): TPathsD;
26-
27-
function InflatePaths(const paths: TPathsD; delta: Double;
28-
joinStyle: TJoinStyle = jsAuto; endStyle: TEndStyle = esPolygon;
29-
miterLimit: double = 2.0; arcTolerance: double = 0.0;
30-
minEdgeLength: double = 0): TPathsD;
31-
32-
//UnionPolygon: removes self-intersections
33-
function UnionPolygon(const polygon: TPathD;
34-
fillRule: TFillRule): TPathsD;
35-
36-
function UnionPolygons(const polygons: TPathsD;
37-
fillRule: TFillRule): TPathsD; overload;
38-
function UnionPolygons(const polygon1, polygon2: TPathD;
39-
fillRule: TFillRule): TPathsD; overload;
40-
function UnionPolygons(const polygons1, polygons2: TPathsD;
41-
fillRule: TFillRule): TPathsD; overload;
42-
43-
function IntersectPolygons(const polygons1, polygons2: TPathsD;
44-
fillRule: TFillRule): TPathsD;
45-
46-
function DifferencePolygons(const polygons1, polygons2: TPathsD;
47-
fillRule: TFillRule): TPathsD;
48-
49-
implementation
50-
51-
//------------------------------------------------------------------------------
52-
//------------------------------------------------------------------------------
53-
54-
function InflatePath(const path: TPathD;
55-
delta: Double; joinStyle: TJoinStyle; endStyle: TEndStyle;
56-
miterLimit: double; arcTolerance: double; minEdgeLength: double): TPathsD;
57-
var
58-
paths: TPathsD;
59-
begin
60-
setLength(paths, 1);
61-
paths[0] := path;
62-
Result := InflatePaths(paths, delta, joinStyle, endStyle,
63-
miterLimit, arcTolerance, minEdgeLength);
64-
end;
65-
//------------------------------------------------------------------------------
66-
67-
function InflatePaths(const paths: TPathsD;
68-
delta: Double; joinStyle: TJoinStyle; endStyle: TEndStyle;
69-
miterLimit: double; arcTolerance: double; minEdgeLength: double): TPathsD;
70-
var
71-
jt: ClipperOffset.TJoinType;
72-
et: TEndType;
73-
begin
74-
case joinStyle of
75-
jsSquare: jt := jtSquare;
76-
jsMiter: jt := jtMiter;
77-
jsRound: jt := jtRound;
78-
else if endStyle = esRound then jt := jtRound
79-
else jt := jtSquare;
80-
end;
81-
case endStyle of
82-
esButt: et := etButt;
83-
esSquare: et := etSquare;
84-
esRound: et := etRound;
85-
else et := etPolygon;
86-
end;
87-
Result := TPathsD(ClipperOffset.InflatePaths(
88-
ClipperCore.TPathsD(paths), delta,
89-
jt, et, miterLimit, arcTolerance, minEdgeLength));
90-
end;
91-
//------------------------------------------------------------------------------
92-
93-
function UnionPolygon(const polygon: TPathD; fillRule: TFillRule): TPathsD;
94-
begin
95-
with TClipperD.Create do
96-
try
97-
AddPath(ClipperCore.TPathD(polygon));
98-
Execute(ctUnion,
99-
ClipperCore.TFillRule(fillRule), ClipperCore.TPathsD(result));
100-
finally
101-
Free;
102-
end;
103-
end;
104-
//------------------------------------------------------------------------------
105-
106-
function UnionPolygons(const polygons: TPathsD;
107-
fillRule: TFillRule): TPathsD;
108-
begin
109-
with TClipperD.Create do
110-
try
111-
AddPaths(ClipperCore.TPathsD(polygons));
112-
Execute(ctUnion,
113-
ClipperCore.TFillRule(fillRule), ClipperCore.TPathsD(result));
114-
finally
115-
Free;
116-
end;
117-
end;
118-
//------------------------------------------------------------------------------
119-
120-
function UnionPolygons(const polygon1, polygon2: TPathD;
121-
fillRule: TFillRule): TPathsD;
122-
begin
123-
with TClipperD.Create do
124-
try
125-
AddPath(ClipperCore.TPathD(polygon1), ptSubject);
126-
AddPath(ClipperCore.TPathD(polygon2), ptClip);
127-
Execute(ctUnion,
128-
ClipperCore.TFillRule(fillRule), ClipperCore.TPathsD(result));
129-
finally
130-
Free;
131-
end;
132-
end;
133-
//------------------------------------------------------------------------------
134-
135-
function UnionPolygons(const polygons1, polygons2: TPathsD;
136-
fillRule: TFillRule): TPathsD;
137-
begin
138-
with TClipperD.Create do
139-
try
140-
AddPaths(ClipperCore.TPathsD(polygons1), ptSubject);
141-
AddPaths(ClipperCore.TPathsD(polygons2), ptClip);
142-
Execute(ctUnion,
143-
ClipperCore.TFillRule(fillRule), ClipperCore.TPathsD(result));
144-
finally
145-
Free;
146-
end;
147-
end;
148-
//------------------------------------------------------------------------------
149-
150-
function IntersectPolygons(const polygons1, polygons2: TPathsD;
151-
fillRule: TFillRule): TPathsD;
152-
begin
153-
with TClipperD.Create do
154-
try
155-
AddPaths(ClipperCore.TPathsD(polygons1), ptSubject);
156-
AddPaths(ClipperCore.TPathsD(polygons2), ptClip);
157-
Execute(ctIntersection,
158-
ClipperCore.TFillRule(fillRule), ClipperCore.TPathsD(result));
159-
finally
160-
Free;
161-
end;
162-
end;
163-
//------------------------------------------------------------------------------
164-
165-
function DifferencePolygons(const polygons1, polygons2: TPathsD;
166-
fillRule: TFillRule): TPathsD;
167-
begin
168-
with TClipperD.Create do
169-
try
170-
AddPaths(ClipperCore.TPathsD(polygons1), ptSubject);
171-
AddPaths(ClipperCore.TPathsD(polygons2), ptClip);
172-
Execute(ctDifference,
173-
ClipperCore.TFillRule(fillRule), ClipperCore.TPathsD(result));
174-
finally
175-
Free;
176-
end;
177-
end;
178-
//------------------------------------------------------------------------------
179-
180-
end.
1+
unit Img32.Clipper;
2+
3+
(*******************************************************************************
4+
* Author : Angus Johnson *
5+
* Version : 2.24 *
6+
* Date : 26 June 2021 *
7+
* Website : http://www.angusj.com *
8+
* Copyright : Angus Johnson 2019-2021 *
9+
* Purpose : Wrapper module for the Clipper library *
10+
* License : http://www.boost.org/LICENSE_1_0.txt *
11+
*******************************************************************************)
12+
13+
interface
14+
15+
uses
16+
ClipperCore, Clipper, ClipperOffset,
17+
Img32, Img32.Draw, Img32.Vector;
18+
19+
//nb: InflatePath assumes that there's consistent winding where
20+
//outer paths wind in one direction and inner paths in the other
21+
22+
function InflatePath(const path: TPathD; delta: Double;
23+
joinStyle: TJoinStyle = jsAuto; endStyle: TEndStyle = esPolygon;
24+
miterLimit: double = 2.0; arcTolerance: double = 0.0;
25+
minEdgeLength: double = 0.25): TPathsD;
26+
27+
function InflatePaths(const paths: TPathsD; delta: Double;
28+
joinStyle: TJoinStyle = jsAuto; endStyle: TEndStyle = esPolygon;
29+
miterLimit: double = 2.0; arcTolerance: double = 0.0;
30+
minEdgeLength: double = 0): TPathsD;
31+
32+
//UnionPolygon: removes self-intersections
33+
function UnionPolygon(const polygon: TPathD;
34+
fillRule: TFillRule): TPathsD;
35+
36+
function UnionPolygons(const polygons: TPathsD;
37+
fillRule: TFillRule): TPathsD; overload;
38+
function UnionPolygons(const polygon1, polygon2: TPathD;
39+
fillRule: TFillRule): TPathsD; overload;
40+
function UnionPolygons(const polygons1, polygons2: TPathsD;
41+
fillRule: TFillRule): TPathsD; overload;
42+
43+
function IntersectPolygons(const polygons1, polygons2: TPathsD;
44+
fillRule: TFillRule): TPathsD;
45+
46+
function DifferencePolygons(const polygons1, polygons2: TPathsD;
47+
fillRule: TFillRule): TPathsD;
48+
49+
implementation
50+
51+
//------------------------------------------------------------------------------
52+
//------------------------------------------------------------------------------
53+
54+
function InflatePath(const path: TPathD;
55+
delta: Double; joinStyle: TJoinStyle; endStyle: TEndStyle;
56+
miterLimit: double; arcTolerance: double; minEdgeLength: double): TPathsD;
57+
var
58+
paths: TPathsD;
59+
begin
60+
setLength(paths, 1);
61+
paths[0] := path;
62+
Result := InflatePaths(paths, delta, joinStyle, endStyle,
63+
miterLimit, arcTolerance, minEdgeLength);
64+
end;
65+
//------------------------------------------------------------------------------
66+
67+
function InflatePaths(const paths: TPathsD;
68+
delta: Double; joinStyle: TJoinStyle; endStyle: TEndStyle;
69+
miterLimit: double; arcTolerance: double; minEdgeLength: double): TPathsD;
70+
var
71+
jt: ClipperOffset.TJoinType;
72+
et: TEndType;
73+
begin
74+
case joinStyle of
75+
jsSquare: jt := jtSquare;
76+
jsMiter: jt := jtMiter;
77+
jsRound: jt := jtRound;
78+
else if endStyle = esRound then jt := jtRound
79+
else jt := jtSquare;
80+
end;
81+
case endStyle of
82+
esButt: et := etButt;
83+
esSquare: et := etSquare;
84+
esRound: et := etRound;
85+
else et := etPolygon;
86+
end;
87+
Result := TPathsD(ClipperOffset.InflatePaths(
88+
ClipperCore.TPathsD(paths), delta,
89+
jt, et, miterLimit, arcTolerance, minEdgeLength));
90+
end;
91+
//------------------------------------------------------------------------------
92+
93+
function UnionPolygon(const polygon: TPathD; fillRule: TFillRule): TPathsD;
94+
begin
95+
with TClipperD.Create do
96+
try
97+
AddPath(ClipperCore.TPathD(polygon));
98+
Execute(ctUnion,
99+
ClipperCore.TFillRule(fillRule), ClipperCore.TPathsD(result));
100+
finally
101+
Free;
102+
end;
103+
end;
104+
//------------------------------------------------------------------------------
105+
106+
function UnionPolygons(const polygons: TPathsD;
107+
fillRule: TFillRule): TPathsD;
108+
begin
109+
with TClipperD.Create do
110+
try
111+
AddPaths(ClipperCore.TPathsD(polygons));
112+
Execute(ctUnion,
113+
ClipperCore.TFillRule(fillRule), ClipperCore.TPathsD(result));
114+
finally
115+
Free;
116+
end;
117+
end;
118+
//------------------------------------------------------------------------------
119+
120+
function UnionPolygons(const polygon1, polygon2: TPathD;
121+
fillRule: TFillRule): TPathsD;
122+
begin
123+
with TClipperD.Create do
124+
try
125+
AddPath(ClipperCore.TPathD(polygon1), ptSubject);
126+
AddPath(ClipperCore.TPathD(polygon2), ptClip);
127+
Execute(ctUnion,
128+
ClipperCore.TFillRule(fillRule), ClipperCore.TPathsD(result));
129+
finally
130+
Free;
131+
end;
132+
end;
133+
//------------------------------------------------------------------------------
134+
135+
function UnionPolygons(const polygons1, polygons2: TPathsD;
136+
fillRule: TFillRule): TPathsD;
137+
begin
138+
with TClipperD.Create do
139+
try
140+
AddPaths(ClipperCore.TPathsD(polygons1), ptSubject);
141+
AddPaths(ClipperCore.TPathsD(polygons2), ptClip);
142+
Execute(ctUnion,
143+
ClipperCore.TFillRule(fillRule), ClipperCore.TPathsD(result));
144+
finally
145+
Free;
146+
end;
147+
end;
148+
//------------------------------------------------------------------------------
149+
150+
function IntersectPolygons(const polygons1, polygons2: TPathsD;
151+
fillRule: TFillRule): TPathsD;
152+
begin
153+
with TClipperD.Create do
154+
try
155+
AddPaths(ClipperCore.TPathsD(polygons1), ptSubject);
156+
AddPaths(ClipperCore.TPathsD(polygons2), ptClip);
157+
Execute(ctIntersection,
158+
ClipperCore.TFillRule(fillRule), ClipperCore.TPathsD(result));
159+
finally
160+
Free;
161+
end;
162+
end;
163+
//------------------------------------------------------------------------------
164+
165+
function DifferencePolygons(const polygons1, polygons2: TPathsD;
166+
fillRule: TFillRule): TPathsD;
167+
begin
168+
with TClipperD.Create do
169+
try
170+
AddPaths(ClipperCore.TPathsD(polygons1), ptSubject);
171+
AddPaths(ClipperCore.TPathsD(polygons2), ptClip);
172+
Execute(ctDifference,
173+
ClipperCore.TFillRule(fillRule), ClipperCore.TPathsD(result));
174+
finally
175+
Free;
176+
end;
177+
end;
178+
//------------------------------------------------------------------------------
179+
180+
end.

0 commit comments

Comments
 (0)