summaryrefslogtreecommitdiff
path: root/js/matrix.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-06-26 10:56:15 -0400
committerJules Laplace <jules@okfoc.us>2015-06-26 10:56:15 -0400
commitd78c08d521c2285afdea8a2ebf866a034d5bf708 (patch)
tree142b5eccf38265c5002faf6292da8b5a1d21e4dc /js/matrix.js
parentc4860b7340f84caf291114a37eece5ce0498ee00 (diff)
fix resize rapper issue
Diffstat (limited to 'js/matrix.js')
-rw-r--r--js/matrix.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/js/matrix.js b/js/matrix.js
index 90ff7fc..a6064ca 100644
--- a/js/matrix.js
+++ b/js/matrix.js
@@ -182,8 +182,28 @@ Matrix.prototype.resize = function(w,h){
this.h = h
this.bind && this.bind()
- if (this.rotated) { controls.rotate.refresh(this.rotated) }
+ this.rapper && this.resize_rapper()
}
+Matrix.prototype.resize_rapper = function(){
+ if (this.rotated) {
+ this.rapper.parentNode.classList.add("rotated")
+ this.rapper.parentNode.style.height = (this.rapper.firstChild.offsetWidth+20) + "px"
+ this.rapper.parentNode.style.width = (this.rapper.offsetHeight+20) + "px"
+ this.rapper.style.top = ((this.rapper.offsetWidth+20)/2) + "px"
+ // this.rapper.style.left = ((canvas_rapper.offsetHeight+20)/2) + "px"
+ }
+ else {
+ var width = this.aa[0][0].span.offsetWidth * this.aa[0].length
+ console.log(width, this.rapper.firstChild.offsetWidth)
+ this.rapper.parentNode.classList.remove("rotated")
+ this.rapper.parentNode.style.height = ""
+ this.rapper.style.width =
+ this.rapper.parentNode.style.width = (width) + "px"
+ this.rapper.style.top = ""
+ // canvas_rapper.style.left = "auto"
+ }
+}
+
//