question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When use smooth graphic, the stroke color is displayed incorrectly

See original GitHub issue

Hi,

I wanted to display think stroke of shapes in drawing canvas using smooth graphic. But it shows me wrong color when I set the line color with black, and it looks blurry. I settled up the line width to 0.5, because compared fabric.js, pixi shows thicker border when I set 1px of line width.

Following screenshot is one of using Pixi Screen Shot 2021-08-16 at 15 03 35

Below is showing fabric.js Screen Shot 2021-08-16 at 15 10 32

Expected Behavior

Show thin border with correct color when set the line width as 1px

Current Behavior

It shows wrong color when set line color with black and set line width as 0.5 , and it looks blurry When use normal graphic class, if I set the line width 0.5, the borders cut off.

Possible Solution

Steps to Reproduce

  • Initialize smooth graphics (or graphics),
  • Drawing rectangle or any shape with 0.5px of line width, and black line color.

Environment

  • pixi.js version: e.g. 4.7.1
  • Browser & Version: e.g. Chrome 67
  • OS & Version: e.g. Ubuntu 18.04
  • Running Example: url

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
ivanpopelyshevcommented, Aug 16, 2021

alternative: lineAlignment

0reactions
guoqiangmincommented, Aug 16, 2021

Great! Thank you @ivanpopelyshev . It worked for me when I adjust corners. Thanks for your quick turn around.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Color Banding in Gradient Animation: 10 Quick Fixes - SVGator
Banding typically becomes extremely noticeable in gradients that use colors that are very close to each other on the color wheel.
Read more >
Solved: Blend Tool Not Making Smooth Color Blend - 5593744
Create your two shapes and give them two different color fills. Use Smooth Color blend and then Object > Expand. Then you can...
Read more >
Painting: Filling, Stroking and Marker Symbols — SVG 2
The marker is defined using a shape whose stroke is set to context-stroke. This causes the marker to take on the color of...
Read more >
Android: Why your Canvas shapes aren't smooth - Medium
A quick Google search will show that this question has been asked on ... In the image below, I show what happens when...
Read more >
Adding Stroke to Web Text | CSS-Tricks
For the record, you can use any type of color value for the color of stroke (hex, rgba, hsla, keyword). That means transparent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found