Skip to content

Commit

Permalink
Fix issue with broken seismic leftToRight option (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
HavardNJ authored Jun 20, 2023
1 parent 09641fe commit c06692b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 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.7",
"version": "3.0.8",
"description": "Intersection component package with testing and automatic documentation.",
"type": "module",
"exports": {
Expand Down
8 changes: 4 additions & 4 deletions src/datautils/seismicimage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ export async function generateSeismicSliceImage(
data: { datapoints: number[][]; yAxisValues: number[] },
trajectory: number[][],
colormap: string[],
options?: {
isLeftToRight: true;
options: {
isLeftToRight: boolean;
seismicRange?: number;
seismicMin?: number;
seismicMax?: number;
},
} = { isLeftToRight: true },
): Promise<ImageBitmap | undefined> {
if (!(data && data.datapoints && data.datapoints.length > 0)) {
return undefined;
Expand Down Expand Up @@ -132,7 +132,7 @@ export async function generateSeismicSliceImage(
let offset = 0;
const colorFactor = (colorTableSize - 1) / domain.difference;

let pos = options?.isLeftToRight ? trajectory[0][0] : trajectory[trajectory.length - 1][0];
let pos = options?.isLeftToRight == null ? trajectory[0][0] : trajectory[trajectory.length - 1][0];

const step = (length / width) * (options?.isLeftToRight ? -1 : 1);

Expand Down

0 comments on commit c06692b

Please sign in to comment.