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.

lineAlignment at small sizes

See original GitHub issue

Expected Behavior

  • Inside stroke is contained within the fillable area of an object (it certainly shouldn’t extend further than center stroke)
  • Outside stroke edges do not clip

Current Behavior

https://pixiplayground.com/#/edit/bvjRVoDSNkUH9TGF_Ihsm

Columns left to right are: Outside, Center, Inside Rows are the same item

image

Possible Solution

Eeek, I know this a tough problem, stuff starts breaking down when stroke is larger than the fillable area.

  • The outside stroke edges clipping looks like a miterLimit issue (could that be exposed for Graphics lineStyle)?
  • Clipping the inside stroke to the fill of the item

Environment

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
georeithcommented, Apr 1, 2020

@SukantPal thanks for the explanation. So my understanding is that its not necessarily the optimal way of it working but its a design decision based on it being more expensive to work out where the fill will be located.

The reason this is an issue for me is that I am building a drawing tool for designers and thus want them to be able to add polygons and choose their line alignment, so I am unable to control the direction of the polygons created.

I will be looking at porting my existing line alignment which uses double width stroke and composite operations to perform inside and outside strokes. Will feedback my success.

1reaction
georeithcommented, Mar 25, 2020

@ivanpopelyshev that’s fair, I am just starting down my journey with pixi.js and evaluating its level of support for our current offering (as we feel the need to move to a more performant base). I have similar time constraints at the moment and like you need to put more time into bigger issues but when this is a larger priority for us I will try and revive the miterLimit and lineJoin issues.

Regarding the inside stroke escaping the fill area has this been evaluated before?

Not sure how you are implementing lineAlignment but I had a canvas 2D solution that doesn’t require path offsetting: https://jsbin.com/merosuranu/1/edit?html,js,output

I think we will fix many vector-related before the end of year, because I’m working on huge Flash-related converted projects. If MiterLimit difficulty is 1 , then stuff I’m working for is likely 200.

This is very exciting 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Dynamically resizing font to fit space while using Graphics ...
In this case text will go out of the Room dimension, if bitmap dpi is larger than system dpi and font size will...
Read more >
vertically align texts of different sizes and allow line breaks - TeX
I would like to vertically align texts of different sizes in latex ( xelatex ). For example, normal {\footnotesize small} normal does base-line...
Read more >
Alignment, font styles, and horizontal rules in HTML documents
A relative increase in font size. The value "+1" means one size larger. The value "-3" means three sizes smaller. All sizes belong...
Read more >
Text Formatting Attributes (Msc-generator 6.3.0)
This can be left , center or right and specifies the line alignment of the label. The default is centering, ... text.size.normal; text.size.small....
Read more >
Why same font size are appearing different at different zoom
Why same font size are appearing different at different zoom level? Image. Please see the end of the line alignment. This thread is...
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