slowe / VirtualSky

A browser-based planetarium that can be customised and embedded in web pages.
http://slowe.github.io/VirtualSky/
247 stars 94 forks source link

Draw galaxy fills outside the stroke area #69

Closed IlkerKadir closed 3 years ago

IlkerKadir commented 4 years ago

Hi

I know this might be outside the scope of the project but you might have an idea about how to prevent this. I added ctx.fill() to the drawGalaxy function to fill inside the milky way area with a given color. The problem is with some dates or lat,long positions the function fills outside the stroked area.

Do you have an idea why this might be happening ?

Thank you very much.

slowe commented 4 years ago

@IlkerKadir You found the reason why the galaxy has not been filled so far. Although the shape is stored as a polygon, it is drawn as lines with line segments that are "behind your head" omitted. This means that a simple fill won't work.