Skip to content

Commit

Permalink
refactor(debug): remove three r124 warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoqueux committed Feb 3, 2021
1 parent 6297c09 commit 9c2406f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Core/Picking.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ export default {
{ scene: object, camera: view.camera },
zone);

const clearColor = view.mainLoop.gfxEngine.renderer.getClearColor();
const clearColor = new THREE.Color();
view.mainLoop.gfxEngine.renderer.getClearColor(clearColor);
const clearR = Math.round(255 * clearColor.r);
const clearG = Math.round(255 * clearColor.g);
const clearB = Math.round(255 * clearColor.b);
Expand Down
6 changes: 3 additions & 3 deletions utils/debug/Debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function Debug(view, datDebugTool, chartDivContainer) {
}
}

const bClearColor = new Color();
const clearColor = new Color();
const lookAtCameraDebug = new Vector3();
function renderCameraDebug() {
if (state.debugCameraWindow && debugCamera) {
Expand Down Expand Up @@ -208,15 +208,15 @@ function Debug(view, datDebugTool, chartDivContainer) {
const deltaY = state.displayCharts ? Math.round(parseFloat(chartDivContainer.style.height.replace('%', '')) * g.height / 100) + 3 : 0;
helper.visible = true;
helper.updateMatrixWorld(true);
bClearColor.copy(r.getClearColor());
r.getClearColor(clearColor);
r.setViewport(g.width - size.x, deltaY, size.x, size.y);
r.setScissor(g.width - size.x, deltaY, size.x, size.y);
r.setScissorTest(true);
r.setClearColor(backgroundChartDiv);
r.clear();
r.render(view.scene, debugCamera);
r.setScissorTest(false);
r.setClearColor(bClearColor);
r.setClearColor(clearColor);
r.setViewport(0, 0, g.width, g.height);

helper.visible = false;
Expand Down

0 comments on commit 9c2406f

Please # to comment.