AstroDraw / AstroChart

A free and open-source TypeScript library for generating SVG charts to display planets in astrology.
https://astrodraw.github.io
MIT License
200 stars 51 forks source link

Bufix: pass settings to from Radix to AspectCalculator #71

Closed harlantwood closed 5 months ago

harlantwood commented 6 months ago

Without this, AspectCalculator will always fall back to default settings, in commented line below:

 class AspectCalculator {
  settings: Partial<Settings>
  toPoints: Points
  context: this
  constructor (toPoints: Points, settings?: Partial<Settings>) {
    if (toPoints == null) {
      throw new Error('Param \'toPoint\' must not be empty.')
    }

    this.settings = settings ?? {}
    this.settings.ASPECTS = settings?.ASPECTS ?? DEFAULT_ASPECTS // <--- `Radix` will always use `DEFAULT_ASPECTS` (before this fix)

    this.toPoints = toPoints

    this.context = this
  }
eve0803 commented 6 months ago

Can you write a case study of passing in ASPECTS settings?

harlantwood commented 6 months ago

Can you write a case study of passing in ASPECTS settings?

Do you mean write a test? Or something else?

harlantwood commented 6 months ago

Added a test, which fails before the bugfix, but passes now that it's added:

Screen Shot 2024-03-11 at 9 41 06 PM