From cfccc3aae2f4aa655d0ca6750e8fa06cf2209a27 Mon Sep 17 00:00:00 2001 From: Oleksandr Zhurbenko Date: Fri, 11 Sep 2015 12:59:33 -0700 Subject: [PATCH] Added outer whitespace to the poll shape, as in the Flash client --- .../whiteboard_models/whiteboard_poll.coffee | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-html5/app/client/whiteboard_models/whiteboard_poll.coffee b/bigbluebutton-html5/app/client/whiteboard_models/whiteboard_poll.coffee index 0e8009e977..f654017f75 100755 --- a/bigbluebutton-html5/app/client/whiteboard_models/whiteboard_poll.coffee +++ b/bigbluebutton-html5/app/client/whiteboard_models/whiteboard_poll.coffee @@ -63,15 +63,29 @@ class @WhiteboardPollModel extends WhiteboardToolModel width = (x2 * @gw + @xOffset) - x height = (y2 * @gh + @yOffset) - y - #creating a base rectangle + #creating a base outer rectangle @obj = @paper.rect(x, y, width, height, 0) - @obj.attr "stroke", "#333333" @obj.attr "fill", backgroundColor - @obj.attr "stroke-width", zoomStroke(formatThickness(thickness)) + @obj.attr "stroke-width", 0 @definition = shape: "poll_result" data: [x1, y1, x2, y2, @obj.attrs["stroke"], @obj.attrs["stroke-width"], @obj.attrs["fill"]] + #recalculated coordinates, width and height for the inner rectangle + width = width*0.95 + height = height - width*0.05 + x = x+width*0.025 + y = y+width*0.025 + + #creating a base inner rectangle + @obj1 = @paper.rect(x, y, width, height, 0) + @obj1.attr "stroke", "#333333" + @obj1.attr "fill", backgroundColor + @obj1.attr "stroke-width", zoomStroke(formatThickness(thickness)) + @definition = + shape: "poll_result" + data: [x1, y1, x2, y2, @obj.attrs["stroke"], @obj1.attrs["stroke-width"], @obj1.attrs["fill"]] + #Calculating a proper font-size, and the maximum widht and height of the objects calculatedData = calculateFontAndWidth(textArray, calcFontSize, width, height, x, y) calcFontSize = calculatedData[0] @@ -137,7 +151,7 @@ class @WhiteboardPollModel extends WhiteboardToolModel #Initial coordinates of the percentage column yRight = y+verticalPadding+barHeight/2 - magicNumber xRight = x + horizontalPadding*3 + maxLeftWidth + maxRightWidth + maxBarWidth + 1 - objects = [@obj, @obj2, @obj3] + objects = [@obj, @obj1, @obj2, @obj3] for i in [0..textArray.length-1] #Adding an element to the left column