Skip to content

Commit 94c6ffe

Browse files
committed
v0.1.7
1 parent 7c74919 commit 94c6ffe

File tree

5 files changed

+35
-12
lines changed

5 files changed

+35
-12
lines changed

changelog.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## [v0.1.7](https://github.com/janosh/matterviz/compare/v0.1.6...v0.1.7)
4+
5+
> 11 August 2025
6+
7+
### 🛠 Enhancements
8+
9+
- Settings reset buttons by @janosh in https://github.com/janosh/matterviz/pull/116
10+
- Supercells by @janosh in https://github.com/janosh/matterviz/pull/117
11+
12+
### 🐛 Bug Fixes
13+
14+
- Fix large trajectory loading in VSCode extension by @janosh in https://github.com/janosh/matterviz/pull/115
15+
- Move structure IO by @janosh in https://github.com/janosh/matterviz/pull/123
16+
- Change default camera projection to orthographic by @janosh in https://github.com/janosh/matterviz/pull/124
17+
- Fix `supported_resource` context for keyboard shortcut `when` in VSCode extension by @janosh in https://github.com/janosh/matterviz/pull/125
18+
19+
### 🧪 Tests
20+
21+
- Improve unit tests by @janosh in https://github.com/janosh/matterviz/pull/118
22+
323
## [v0.1.6](https://github.com/janosh/matterviz/compare/v0.1.5...v0.1.6)
424

525
> 28 July 2025

extensions/vscode/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "matterviz",
33
"displayName": "MatterViz",
44
"description": "Visualize crystal structures and MD trajectories in VSCode",
5-
"version": "0.1.6",
5+
"version": "0.1.7",
66
"publisher": "janosh",
77
"icon": "icon.png",
88
"repository": "https://github.com/janosh/matterviz",
@@ -17,7 +17,9 @@
1717
"vscode": "^1.96.0"
1818
},
1919
"main": "./dist/extension.cjs",
20-
"activationEvents": ["onStartupFinished"],
20+
"activationEvents": [
21+
"onStartupFinished"
22+
],
2123
"contributes": {
2224
"commands": [
2325
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"homepage": "https://janosh.github.io/matterviz",
66
"repository": "https://github.com/janosh/matterviz",
77
"license": "MIT",
8-
"version": "0.1.6",
8+
"version": "0.1.7",
99
"type": "module",
1010
"svelte": "./dist/index.js",
1111
"bugs": "https://github.com/janosh/matterviz/issues",

src/lib/structure/StructureControls.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import type { AnyStructure } from '$lib'
33
import { DraggablePanel, SettingsSection } from '$lib'
44
import { type ColorSchemeName, element_color_schemes } from '$lib/colors'
5+
import { export_canvas_as_png } from '$lib/io/export'
56
import { DEFAULTS, SETTINGS_CONFIG } from '$lib/settings'
67
import { StructureScene } from '$lib/structure'
78
import * as exports from '$lib/structure/export'
@@ -169,7 +170,7 @@
169170
xyz: exports.export_structure_as_xyz,
170171
cif: exports.export_structure_as_cif,
171172
poscar: exports.export_structure_as_poscar,
172-
}
173+
} as const
173174
export_fns[format](structure)
174175
}
175176
@@ -317,7 +318,7 @@
317318
onclick={() => {
318319
const canvas = wrapper?.querySelector(`canvas`) as HTMLCanvasElement
319320
if (canvas) {
320-
exports.export_canvas_as_png(
321+
export_canvas_as_png(
321322
canvas,
322323
structure,
323324
png_dpi,

src/lib/structure/StructureScene.svelte

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,15 @@
149149
// Persisted zoom; recompute only on viewport changes
150150
let computed_zoom = $state<number>(initial_zoom)
151151
$effect(() => {
152-
if (width > 0 && height > 0) return
152+
if (!(width > 0) || !(height > 0)) return
153153
// Avoid depending on structure/structure_size so trajectories don't retrigger zoom
154154
const structure_max_dim = Math.max(1, untrack(() => structure_size))
155155
const viewer_min_dim = Math.min(width, height)
156156
const scale_factor = viewer_min_dim / (structure_max_dim * 50) // 50px per unit
157-
let next = initial_zoom * scale_factor
158-
if (min_zoom != null) next = Math.max(min_zoom, next)
159-
if (max_zoom != null) next = Math.min(max_zoom, next)
160-
computed_zoom = next
157+
let new_zoom = initial_zoom * scale_factor
158+
if (min_zoom && min_zoom > 0) new_zoom = Math.max(min_zoom, new_zoom)
159+
if (max_zoom && max_zoom > 0) new_zoom = Math.min(max_zoom, new_zoom)
160+
computed_zoom = new_zoom
161161
})
162162
163163
$effect.pre(() => {
@@ -308,8 +308,8 @@
308308
enablePan: pan_speed > 0,
309309
panSpeed: pan_speed,
310310
target: rotation_target,
311-
maxZoom: camera_projection === `orthographic` ? (max_zoom ?? 200) : max_zoom,
312-
minZoom: camera_projection === `orthographic` ? (min_zoom ?? 0.1) : min_zoom,
311+
maxZoom: camera_projection === `orthographic` ? (max_zoom || 200) : max_zoom,
312+
minZoom: camera_projection === `orthographic` ? (min_zoom || 0.1) : min_zoom,
313313
autoRotate: Boolean(auto_rotate),
314314
autoRotateSpeed: auto_rotate,
315315
enableDamping: Boolean(rotation_damping),

0 commit comments

Comments
 (0)