Skip to content

Commit

Permalink
Merge branch 'v0.32'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Apr 17, 2024
2 parents 085f3db + 7786d92 commit 042253e
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 6 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [v0.32.5](https://github.com/ivmartel/dwv/releases/tag/v0.32.5) - 17/04/2024

### Fixed

- Image does not completely fill div [#1655](https://github.com/ivmartel/dwv/issues/1655)

## [v0.32.4](https://github.com/ivmartel/dwv/releases/tag/v0.32.4) - 18/03/2024

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion dist/dwv.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dwv.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dwv",
"version": "0.32.4",
"version": "0.32.5",
"description": "DICOM Web Viewer.",
"keywords": [
"DICOM",
Expand Down
4 changes: 2 additions & 2 deletions resources/doc/jsdoc.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"package": "package.json",
"theme_opts": {
"title": "DWV",
"footer": "<i>Documentation generated for dwv v0.32.4.</i>",
"footer": "<i>Documentation generated for dwv v0.32.5.</i>",
"sections": [
"Tutorials",
"Namespaces",
Expand All @@ -50,7 +50,7 @@
"codepen": {
"enable_for": ["examples"],
"options": {
"js_external": "https://github.com/ivmartel/dwv/releases/download/v0.32.4/dwv-0.32.4.min.js",
"js_external": "https://github.com/ivmartel/dwv/releases/download/v0.32.5/dwv-0.32.5.min.js",
"html": "<div id='dwv'><div id='layerGroup0'></div></div>"
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/dicom/dicomParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {DataElement} from '../dicom/dataElement';
* @returns {string} The version of the library.
*/
export function getDwvVersion() {
return '0.32.4';
return '0.32.5';
}

/**
Expand Down
8 changes: 8 additions & 0 deletions src/gui/layerGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,14 @@ export class LayerGroup {
if (typeof maxSize === 'undefined') {
return undefined;
}
// if the container has a width but no height,
// resize it to follow the same ratio to completely
// fill the div with the image
if (this.#containerDiv.offsetHeight === 0) {
const ratioX = this.#containerDiv.offsetWidth / maxSize.x;
const height = maxSize.y * ratioX;
this.#containerDiv.style.height = height + 'px';
}
// return best fit
return Math.min(
this.#containerDiv.offsetWidth / maxSize.x,
Expand Down

0 comments on commit 042253e

Please sign in to comment.