File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -1296,13 +1296,19 @@ public final class Gtk3Backend: AppBackend {
1296
1296
}
1297
1297
}
1298
1298
1299
- for action in actions {
1299
+ for (index , action) in actions. enumerated ( ) {
1300
1300
switch action {
1301
1301
case . moveTo( let point) :
1302
1302
cairo_move_to ( cairo, point. x, point. y)
1303
1303
case . lineTo( let point) :
1304
+ if index == 0 {
1305
+ cairo_move_to ( cairo, 0 , 0 )
1306
+ }
1304
1307
cairo_line_to ( cairo, point. x, point. y)
1305
1308
case . quadCurve( let control, let end) :
1309
+ if index == 0 {
1310
+ cairo_move_to ( cairo, 0 , 0 )
1311
+ }
1306
1312
var startX = 0.0
1307
1313
var startY = 0.0
1308
1314
cairo_get_current_point ( cairo, & startX, & startY)
@@ -1316,6 +1322,9 @@ public final class Gtk3Backend: AppBackend {
1316
1322
end. x, end. y
1317
1323
)
1318
1324
case . cubicCurve( let control1, let control2, let end) :
1325
+ if index == 0 {
1326
+ cairo_move_to ( cairo, 0 , 0 )
1327
+ }
1319
1328
cairo_curve_to (
1320
1329
cairo,
1321
1330
control1. x, control1. y,
Original file line number Diff line number Diff line change @@ -1341,13 +1341,19 @@ public final class GtkBackend: AppBackend {
1341
1341
}
1342
1342
}
1343
1343
1344
- for action in actions {
1344
+ for (index , action) in actions. enumerated ( ) {
1345
1345
switch action {
1346
1346
case . moveTo( let point) :
1347
1347
cairo_move_to ( cairo, point. x, point. y)
1348
1348
case . lineTo( let point) :
1349
+ if index == 0 {
1350
+ cairo_move_to ( cairo, 0 , 0 )
1351
+ }
1349
1352
cairo_line_to ( cairo, point. x, point. y)
1350
1353
case . quadCurve( let control, let end) :
1354
+ if index == 0 {
1355
+ cairo_move_to ( cairo, 0 , 0 )
1356
+ }
1351
1357
var startX = 0.0
1352
1358
var startY = 0.0
1353
1359
cairo_get_current_point ( cairo, & startX, & startY)
@@ -1361,6 +1367,9 @@ public final class GtkBackend: AppBackend {
1361
1367
end. x, end. y
1362
1368
)
1363
1369
case . cubicCurve( let control1, let control2, let end) :
1370
+ if index == 0 {
1371
+ cairo_move_to ( cairo, 0 , 0 )
1372
+ }
1364
1373
cairo_curve_to (
1365
1374
cairo,
1366
1375
control1. x, control1. y,
Original file line number Diff line number Diff line change @@ -201,8 +201,11 @@ public struct Path {
201
201
/// The types of actions that can be performed on a path.
202
202
public enum Action : Equatable {
203
203
case moveTo( SIMD2 < Double > )
204
+ /// If this is the first action in a path then (0, 0) is inferred to be the start point.
204
205
case lineTo( SIMD2 < Double > )
206
+ /// If this is the first action in a path then (0, 0) is inferred to be the start point.
205
207
case quadCurve( control: SIMD2 < Double > , end: SIMD2 < Double > )
208
+ /// If this is the first action in a path then (0, 0) is inferred to be the start point.
206
209
case cubicCurve( control1: SIMD2 < Double > , control2: SIMD2 < Double > , end: SIMD2 < Double > )
207
210
case rectangle( Rect )
208
211
case circle( center: SIMD2 < Double > , radius: Double )
You can’t perform that action at this time.
0 commit comments