Add method to Canvas for refreshing the 3D view

This commit is contained in:
Rikard Bartholf
2017-05-19 11:46:28 +02:00
parent 7983769dff
commit 587ad487e7
2 changed files with 12 additions and 3 deletions
+11
View File
@@ -104,6 +104,17 @@ var Canvas = fabric.util.createClass(fabric.Canvas, {
return this.__buttonMenu; return this.__buttonMenu;
}, },
/**
* Reloads the 3D view, if it is present
* @return {Canvas}
*/
refresh3dView: function () {
if (this.get3dHandler().isEnabled()) {
this.toggle3D(true);
}
return this;
},
/** /**
* @return {Canvas} * @return {Canvas}
*/ */
+1 -3
View File
@@ -140,9 +140,7 @@ function Viewport(canvas) {
*/ */
this.setFrame = function (frameType) { this.setFrame = function (frameType) {
this.getFrameHandler().setFrames(frameType); this.getFrameHandler().setFrames(frameType);
if (canvas.get3dHandler().isEnabled()) { canvas.refresh3dView();
canvas.toggle3D(true);
}
}; };
this.getData = function () { this.getData = function () {