Skip to content

Commit

Permalink
fix(track): prevent circular layout legend from being obscured (#1029)
Browse files Browse the repository at this point in the history
fix: circular mask only when overlaid
  • Loading branch information
etowahadams committed Jan 10, 2024
1 parent bf470c1 commit e1649af
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/tracks/gosling-track/gosling-track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,11 +522,10 @@ const factory: PluginTrackFactory<Tile, GoslingTrackOptions> = (HGC, context, op
this.pMask.clear();
this.pMask.beginFill();

if (this.options.spec.layout === 'circular') {
if (this.options.spec.layout === 'circular' && this.options.spec.overlayOnPreviousTrack) {
/**
* If the layout is circular, we want the mask to be circular as well.
* Circular layout have multiple tracks on top of each other so if the mask is not circular, click
* events will be triggered only on the top track.
* If the layout is circular and is overlaid on another track, the mask should be circular
* so outer tracks can still receive click events.
*/
const [x, y] = this.position;
const [width, height] = this.dimensions;
Expand Down

0 comments on commit e1649af

Please sign in to comment.