Skip to content

Commit

Permalink
Made canvas resize when window/editor changes size
Browse files Browse the repository at this point in the history
  • Loading branch information
phschaad committed Jun 14, 2020
1 parent dfb735a commit a9ad7ee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 0.1.8

- Made canvas resize correctly when VSCode window or editor is resized.

## 0.1.7

- Inherit SDFV button styles from VSCode
Expand Down
11 changes: 10 additions & 1 deletion media/sdfv_base_layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<script src="{{ CSP_SRC }}/renderer.js"></script>
</head>

<body>
<body onresize="rendererSendResize();">
<div id="top-bar">
<div id="search-bar">
<div id="search-container">
Expand Down Expand Up @@ -94,6 +94,15 @@ <h3 id="info-title"></h3>
}
});

// Resize the canvas correctly if the renderer exists. This gets
// called whenever the body's size changes.
function rendererSendResize() {
if (renderer) {
renderer.onresize();
renderer.draw_async();
}
}

Split(['#contents', '#info-container'], {
sizes: [60, 40],
minSize: [0, 0],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "sdfv",
"displayName": "DaCe SDFG Viewer (SDFV)",
"description": "DaCe SDFG Viewer (SDFV) for VS Code",
"version": "0.1.7",
"version": "0.1.8",
"engines": {
"vscode": "^1.45.1"
},
Expand Down

0 comments on commit a9ad7ee

Please sign in to comment.