From d4407556caefd1f385f70df88983b9a20a0f1189 Mon Sep 17 00:00:00 2001 From: mntmn Date: Sun, 27 Sep 2020 23:32:26 +0200 Subject: [PATCH] space/notes: default to more useful note size and padding --- public/javascripts/spacedeck_sections.js | 2 -- public/javascripts/spacedeck_whiteboard.js | 17 ++++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/public/javascripts/spacedeck_sections.js b/public/javascripts/spacedeck_sections.js index 540d0ae..6a90a19 100644 --- a/public/javascripts/spacedeck_sections.js +++ b/public/javascripts/spacedeck_sections.js @@ -1134,8 +1134,6 @@ var SpacedeckSections = { this.active_space.width =Math.max((parseInt(er.x2/window.innerWidth)+2)*window.innerWidth, window.innerWidth); this.active_space.height=Math.max((parseInt(er.y2/window.innerHeight)+2)*window.innerHeight, window.innerHeight); - console.log("bounds: ",this.active_space.width,this.active_space.height); - if (this._last_bounds_width != this.active_space.width || this._last_bounds_height != this.active_space.height) { this._last_bounds_width = this.active_space.width; diff --git a/public/javascripts/spacedeck_whiteboard.js b/public/javascripts/spacedeck_whiteboard.js index f1f2ed2..9df9987 100644 --- a/public/javascripts/spacedeck_whiteboard.js +++ b/public/javascripts/spacedeck_whiteboard.js @@ -530,20 +530,27 @@ function setup_whiteboard_directives() { var point = this.cursor_point_to_space(evt); var z = $scope.highest_z()+1; + var note_w = 250; + var note_h = 250; + var a = { space_id: $scope.active_space._id, mime: "text/html", description: "

Text

", - x: point.x, - y: point.y, + x: point.x-note_w/2, + y: point.y-note_h/2, z: z, - w: 64, - h: 64, + w: note_w, + h: note_h, align: "center", valign: "middle", stroke_color: "#000000", fill_color: "rgb(241, 196, 15)", - stroke: 0 + stroke: 0, + padding_left: 10, + padding_right: 10, + padding_top: 10, + padding_bottom: 10 }; $scope.save_artifact(a, function(saved_a) {