Skip to content

Commit

Permalink
Fix issues where groups had labels and where last label was not rende…
Browse files Browse the repository at this point in the history
…red (#594)
  • Loading branch information
HavardNJ authored May 25, 2023
1 parent 49866fb commit 3b7cad2
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@equinor/esv-intersection",
"version": "3.0.3",
"version": "3.0.4",
"description": "Intersection component package with testing and automatic documentation.",
"type": "module",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion src/datautils/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface SurfaceLine {
*/
export interface SurfaceArea {
id?: string;
label: string;
label?: string;
color: number | string; // Color is passed to pixi.js and accepts both CSS color strings and hex color value
data: number[][];
exclude?: boolean;
Expand Down
1 change: 0 additions & 1 deletion src/datautils/surfacedata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ function generateGroupAreas(groups: MappedGroup[], trajectory: number[][]): Surf
const next: MappedGroup | null = i + 1 < groups.length ? groups[i + 1] : null;
return {
id: g.id,
label: g.label,
color: convertColor(g.color),
data: trajectory.map((p: number[], j: number) => [p[0], g.top[j], next ? next.top[j] : null]),
};
Expand Down
6 changes: 1 addition & 5 deletions src/layers/GeomodelLabelsLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ export class GeomodelLabelsLayer<T extends SurfaceData> extends CanvasLayer<T> {
return acc;
}, null);

if (!topmostSurfaceNotDrawnYet) {
return;
}

this.drawAreaLabel(s, topmostSurfaceNotDrawnYet, array, i);
});
}
Expand All @@ -154,7 +150,7 @@ export class GeomodelLabelsLayer<T extends SurfaceData> extends CanvasLayer<T> {
this.data.lines.filter((surfaceLine: SurfaceLine) => surfaceLine.label).forEach((surfaceLine: SurfaceLine) => this.drawLineLabel(surfaceLine));
}

drawAreaLabel = (surfaceArea: SurfaceArea, nextSurfaceArea: SurfaceArea, surfaces: SurfaceArea[], i: number): void => {
drawAreaLabel = (surfaceArea: SurfaceArea, nextSurfaceArea: SurfaceArea | null, surfaces: SurfaceArea[], i: number): void => {
const { data } = surfaceArea;
const { ctx, maxFontSizeInWorldCoordinates, isXFlipped } = this;
const { xScale, yScale, xRatio, yRatio, zFactor } = this.rescaleEvent;
Expand Down

0 comments on commit 3b7cad2

Please sign in to comment.