Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
fix direct lineTo issue in canvas.
  • Loading branch information
kgdev committed Mar 29, 2019
1 parent b9b6df0 commit 42f183e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README-ZH.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Runtime/ui/painting/path.cs
Expand Up @@ -136,13 +136,19 @@ public class Path {
var cmd = (PathCommand) commands[i];
switch (cmd) {
case PathCommand.moveTo:
this._commandx = commands[i + 1];
this._commandy = commands[i + 2];
i += 3;
break;
case PathCommand.lineTo:
this._expandBounds(this._commandx, this._commandy);
this._expandBounds(commands[i + 1], commands[i + 2]);
this._commandx = commands[i + 1];
this._commandy = commands[i + 2];
i += 3;
break;
case PathCommand.bezierTo:
this._expandBounds(this._commandx, this._commandy);
this._expandBounds(commands[i + 1], commands[i + 2]);
this._expandBounds(commands[i + 3], commands[i + 4]);
this._expandBounds(commands[i + 5], commands[i + 6]);
Expand Down Expand Up @@ -1115,6 +1121,7 @@ class PathCache {
void _addPoint(PathPoint point) {
if (this._paths.Count == 0) {
this.addPath();
this.addPoint(0, 0, PointFlags.corner);
}

var path = this._paths.Last();
Expand Down

0 comments on commit 42f183e

Please sign in to comment.