Skip to content

Commit

Permalink
fix(xbilparser): apply zmin / zmax for any texture subsampling size
Browse files Browse the repository at this point in the history
  • Loading branch information
airnez committed Nov 15, 2024
1 parent 0499f95 commit 745ab2c
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/Parser/XbilParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,17 @@ export function computeMinMaxElevation(texture, pitch, options) {
}
}
}
// Clamp values to zmin and zmax values configured in ElevationLayer
if (options.zmin != null) {
if (min < options.zmin) { min = options.zmin; }
if (max < options.zmin) { max = options.zmin; }
}
}

if (options.zmax != null) {
if (min > options.zmax) { min = options.zmax; }
if (max > options.zmax) { max = options.zmax; }
}
// Clamp values to zmin and zmax values configured in ElevationLayer
if (options.zmin != null) {
if (min < options.zmin) { min = options.zmin; }
if (max < options.zmin) { max = options.zmin; }
}

if (options.zmax != null) {
if (min > options.zmax) { min = options.zmax; }
if (max > options.zmax) { max = options.zmax; }
}

if (max === -Infinity || min === Infinity) {
Expand Down

0 comments on commit 745ab2c

Please sign in to comment.