Commit 169d2f72 authored by amandaghassaei's avatar amandaghassaei

video scale

parent 9af7e032
...@@ -452,6 +452,10 @@ a.seeMore.closed>.fui-triangle-down{ ...@@ -452,6 +452,10 @@ a.seeMore.closed>.fui-triangle-down{
transform: rotate(45deg); transform: rotate(45deg);
} }
#screenCaptureModal .modal-content{
background: rgba(255,255,255,0.9);
}
#recordStatus{ #recordStatus{
position: absolute; position: absolute;
bottom:20px; bottom:20px;
......
...@@ -196,11 +196,17 @@ function initControls(globals){ ...@@ -196,11 +196,17 @@ function initControls(globals){
setLink("#createVideo", function(){ setLink("#createVideo", function(){
//quality 0-63 //quality 0-63
//timeLimit: 30 //timeLimit: 30
globals.shouldScaleCanvas = true;
$("#screenCaptureModal").modal("show"); $("#screenCaptureModal").modal("show");
$("#screenRecordFilename").val(globals.filename); $("#screenRecordFilename").val(globals.filename);
globals.screenRecordFilename = globals.filename; globals.screenRecordFilename = globals.filename;
globals.threeView.onWindowResize();
updateCanvasDimensions(); updateCanvasDimensions();
}); });
$("#screenCaptureModal").on('hidden.bs.modal', function (){
globals.shouldScaleCanvas = false;
globals.threeView.onWindowResize();
});
setInput("#capturerFPS", globals.capturerFPS, function(val){ setInput("#capturerFPS", globals.capturerFPS, function(val){
globals.capturerFPS = val; globals.capturerFPS = val;
}, 0, 60); }, 0, 60);
...@@ -209,6 +215,7 @@ function initControls(globals){ ...@@ -209,6 +215,7 @@ function initControls(globals){
}, 0, 63); }, 0, 63);
setInput("#capturerScale", globals.capturerScale, function(val){ setInput("#capturerScale", globals.capturerScale, function(val){
globals.capturerScale = val; globals.capturerScale = val;
globals.threeView.onWindowResize();
updateCanvasDimensions(); updateCanvasDimensions();
}, 1); }, 1);
function updateCanvasDimensions(){ function updateCanvasDimensions(){
...@@ -232,6 +239,7 @@ function initControls(globals){ ...@@ -232,6 +239,7 @@ function initControls(globals){
quality: globals.capturerQuality quality: globals.capturerQuality
}); });
$("#recordStatus").show(); $("#recordStatus").show();
globals.shouldScaleCanvas = false;
globals.capturer.start(); globals.capturer.start();
}); });
...@@ -240,6 +248,8 @@ function initControls(globals){ ...@@ -240,6 +248,8 @@ function initControls(globals){
globals.capturer.stop(); globals.capturer.stop();
globals.capturer.save(); globals.capturer.save();
globals.capturer = null; globals.capturer = null;
globals.shouldScaleCanvas = false;
globals.threeView.onWindowResize();
$("#recordStatus").hide(); $("#recordStatus").hide();
}); });
......
...@@ -89,7 +89,8 @@ function initGlobals(){ ...@@ -89,7 +89,8 @@ function initGlobals(){
capturerQuality: 63, capturerQuality: 63,
capturerFPS: 60, capturerFPS: 60,
capturerScale: 1, capturerScale: 1,
capturerFrames: 0 capturerFrames: 0,
shouldScaleCanvas: false
}; };
function setCreasePercent(percent){ function setCreasePercent(percent){
......
...@@ -152,7 +152,9 @@ function initThreeView(globals) { ...@@ -152,7 +152,9 @@ function initThreeView(globals) {
// camera.bottom = -window.innerHeight / 2; // camera.bottom = -window.innerHeight / 2;
camera.updateProjectionMatrix(); camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight); var scale = 1;
if (globals.shouldScaleCanvas) scale = globals.capturerScale;
renderer.setSize(scale*window.innerWidth, scale*window.innerHeight);
controls.handleResize(); controls.handleResize();
} }
...@@ -201,7 +203,6 @@ function initThreeView(globals) { ...@@ -201,7 +203,6 @@ function initThreeView(globals) {
scene.background.setStyle( "#" + globals.backgroundColor); scene.background.setStyle( "#" + globals.backgroundColor);
} }
return { return {
sceneAddModel: sceneAddModel, sceneAddModel: sceneAddModel,
sceneClearModel: sceneClearModel, sceneClearModel: sceneClearModel,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment