Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[g-plugin-device-renderer] Path 填充有误 #1447

Closed
xiaoiver opened this issue Jul 31, 2023 · 3 comments
Closed

[g-plugin-device-renderer] Path 填充有误 #1447

xiaoiver opened this issue Jul 31, 2023 · 3 comments
Assignees
Labels

Comments

@xiaoiver
Copy link
Contributor

Image
Image

@xiaoiver
Copy link
Contributor Author

xiaoiver commented Aug 11, 2023

复现 path 为,可以看出 stroke 绘制是正确的,应该是 earcut 填充有误:

const path = new Path({
  style: {
    stroke: 'black',
    fill: '#54BECC',
    path: [
      ['M', 200, 50],
      ['A', 200, 200, 0, 0, 1, 400, 250],
      ['A', 200, 200, 0, 0, 1, 200.00000000000003, 450],
      ['A', 200, 200, 0, 0, 1, 0, 250.00000000000003],
      ['L', 33.333333333333314, 250.00000000000003],
      ['M', 33.333333333333314, 250.00000000000003], // 这条命令实际可以去掉
      [
        'A',
        166.66666666666669,
        166.66666666666669,
        0,
        0,
        0,
        200.00000000000003,
        416.6666666666667,
      ],
      [
        'A',
        166.66666666666669,
        166.66666666666669,
        0,
        0,
        0,
        366.6666666666667,
        250,
      ],
      [
        'A',
        166.66666666666669,
        166.66666666666669,
        0,
        0,
        0,
        200,
        83.33333333333331,
      ],
      ['L', 200, 50],
    ],
  },
});
截屏2023-08-11 上午11 42 03

解析 path 时应该去掉多余的 M 命令。

@xiaoiver
Copy link
Contributor Author

已修复

截屏2023-08-11 下午2 32 41

xiaoiver added a commit that referenced this issue Aug 11, 2023
* fix: polyfill for performance.now

* chore: commit changeset

* fix: path should downgrade to line and support billboard effect #1443

* fix: remove redundant m commands when parsing path #1447

* fix: removing redundant m command should account for prev z command

* chore: commit changeset

* chore: use get-pixels loading local image instead of fetching in ssr #1471
xiaoiver added a commit that referenced this issue Aug 11, 2023
* fix: path should downgrade to line and support billboard effect (#1469)

* fix: polyfill for performance.now

* chore: commit changeset

* fix: path should downgrade to line and support billboard effect #1443

* fix: remove redundant m commands when parsing path #1447

* fix: removing redundant m command should account for prev z command

* chore: commit changeset

* chore: use get-pixels loading local image instead of fetching in ssr #1471

* chore(release): bump version (#1472)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@xiaoiver xiaoiver reopened this Aug 16, 2023
@xiaoiver
Copy link
Contributor Author

Path 渐变填充有误:

截屏2023-08-16 上午11 21 49

xiaoiver added a commit that referenced this issue Aug 28, 2023
xiaoiver added a commit that referenced this issue Aug 29, 2023
* feat: support lambert material

* fix: gradient for path in webgl #1447

* fix: fill subpath correctly in webgl #1429

* feat: add cone, cylinder and capsule geometry

* chore: update pnpm lock

* chore: commit changeset
xiaoiver added a commit that referenced this issue Aug 29, 2023
* feat: support lambert material (#1501)

* feat: support lambert material

* fix: gradient for path in webgl #1447

* fix: fill subpath correctly in webgl #1429

* feat: add cone, cylinder and capsule geometry

* chore: update pnpm lock

* chore: commit changeset

* chore(release): bump version (#1503)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant