visual-song 0.3.7 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -24,7 +24,6 @@ type VisualSongRef = {
24
24
  setVertexCount(count: number): void;
25
25
  getLastCompileError(): string;
26
26
  updateLayout(): void;
27
- _resizeRenderer(width: number, height: number): void;
28
27
  _render(): void;
29
28
  };
30
29
  type Props = {
package/dist/index.js CHANGED
@@ -9657,9 +9657,6 @@ const VisualSong = /*#__PURE__*/ forwardRef(function VisualSong({ style, mainLoo
9657
9657
  updateLayout () {
9658
9658
  updateLayout();
9659
9659
  },
9660
- _resizeRenderer (width, height) {
9661
- _resizeRenderer(width, height);
9662
- },
9663
9660
  _render () {
9664
9661
  module.current.frame();
9665
9662
  }
@@ -9791,7 +9788,6 @@ const VisualSong = /*#__PURE__*/ forwardRef(function VisualSong({ style, mainLoo
9791
9788
  if (audioFile !== undefined && audioFile !== null) {
9792
9789
  loadAudioFileInternal(audioFile);
9793
9790
  }
9794
- _resizeRenderer(temp_buffer_size, temp_buffer_size);
9795
9791
  updateLayout();
9796
9792
  if (initializedCallback !== undefined) {
9797
9793
  initializedCallback();
@@ -9800,6 +9796,9 @@ const VisualSong = /*#__PURE__*/ forwardRef(function VisualSong({ style, mainLoo
9800
9796
  });
9801
9797
  }
9802
9798
  function _resizeRenderer(width, height) {
9799
+ if (!module.current) {
9800
+ return;
9801
+ }
9803
9802
  module.current.Renderer.getInstance().resize(width, height);
9804
9803
  canvasRef.current.width = width;
9805
9804
  canvasRef.current.height = height;
@@ -9815,6 +9814,7 @@ const VisualSong = /*#__PURE__*/ forwardRef(function VisualSong({ style, mainLoo
9815
9814
  if (!wrapperWidth || !wrapperHeight) {
9816
9815
  return;
9817
9816
  }
9817
+ _resizeRenderer(window.devicePixelRatio * wrapperWidth, window.devicePixelRatio * wrapperHeight);
9818
9818
  const divAspectRatio = wrapperWidth / wrapperHeight;
9819
9819
  if (1.0 > divAspectRatio) {
9820
9820
  canvas.style.setProperty("width", "100%");
@@ -9827,7 +9827,7 @@ const VisualSong = /*#__PURE__*/ forwardRef(function VisualSong({ style, mainLoo
9827
9827
  function destroy() {
9828
9828
  if (module.current) {
9829
9829
  module.current.deInitialize();
9830
- if (module.current) module.current.canvas = null;
9830
+ if (module.current) module.current["canvas"] = null;
9831
9831
  module.current = null;
9832
9832
  }
9833
9833
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "visual-song",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
4
4
  "description": "visual-song core library",
5
5
  "author": "kunyoungparkk (rjsdud3263@gmail.com)",
6
6
  "license": "MIT",