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

[Bug] The gradient color effect of the "outerBorder.stroke" is not correct. #343

Closed
xiaoluoHe opened this issue Aug 21, 2023 · 0 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@xiaoluoHe
Copy link
Contributor

xiaoluoHe commented Aug 21, 2023

Version

0.14.0

Link to Minimal Reproduction

none

Steps to Reproduce

import { createStage, createSymbol, container, IGraphic } from '@visactor/vrender';

// container.load(roughModule);

export const page = () => {
  const symbolList = [
    'circle',
    'cross',
    'diamond',
    'square',
    'arrow',
    'arrow2Left',
    'arrow2Right',
    'wedge',
    'thinTriangle',
    'triangle',
    'triangleUp',
    'triangleDown',
    'triangleRight',
    'triangleLeft',
    'stroke',
    'star',
    'wye',
    'rect',
    'M -2 2 L 4 -5 L 7 -6 L 6 -3 L -1 3 C 0 4 0 5 1 4 C 1 5 2 6 1 6 A 1.42 1.42 0 0 1 0 7 A 5 5 0 0 0 -2 4 Q -2.5 3.9 -2.5 4.5 T -4 5.8 T -4.8 5 T -3.5 3.5 T -3 3 A 5 5 90 0 0 -6 1 A 1.42 1.42 0 0 1 -5 0 C -5 -1 -4 0 -3 0 C -4 1 -3 1 -2 2 M 4 -5 L 4 -3 L 6 -3 L 5 -4 L 4 -5'
  ];
  const graphics: IGraphic[] = [];

  symbolList.forEach((st, i) => {
    const attrs = {
      symbolType: st,
      x: ((i * 100) % 500) + 100,
      y: (Math.floor((i * 100) / 500) + 1) * 100,
      size: 60,
      fill: 'pink',
      outerBorder: {
        stroke: {
          gradient: 'radial',
          x0: 0.5,
          y0: 0.5,
          r0: 0,
          x1: 0.5,
          y1: 0.5,
          r1: 0.7,
          stops: [
            {
              offset: 0,
              color: 'red'
            },
            {
              offset: 1,
              color: '#6690F2'
            }
          ]
        },
        distance: 10,
        lineWidth: 4,
        strokeOpacity: 0.2
      }
    };
    const symbol = createSymbol(attrs);
    console.log(attrs);
    symbol.addEventListener('mouseenter', () => {
      symbol.setAttribute('fill', 'blue');
    });
    graphics.push(symbol);
  });

  const stage = createStage({
    canvas: 'main',
    autoRender: true
  });

  graphics.forEach(g => {
    stage.defaultLayer.add(g);
  });
};

Current Behavior

image

Expected Behavior

image

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@xiaoluoHe xiaoluoHe added the bug Something isn't working label Aug 21, 2023
@neuqzxy neuqzxy added this to the 0.14.5 milestone Aug 22, 2023
neuqzxy added a commit that referenced this issue Aug 23, 2023
fix: fix the issue with outerborder gradient color, closed #343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants