fixed the poll display so that vote count is always visible

This commit is contained in:
Chad Pilkey 2015-08-19 13:13:13 -04:00
parent 8d232ac103
commit f84d479f9b
2 changed files with 18 additions and 7 deletions

View File

@ -122,7 +122,7 @@ package org.bigbluebutton.modules.polling.views
var startingLabelWidth:Number = Math.min(labelWidthPercent*unscaledWidth, labelMaxWidthInPixels);
graphics.lineStyle(2);
graphics.lineStyle(2, colFill);
graphics.beginFill(colFill, 1.0);
for (var j:int=0, vp:int=extraVPixels, ry:int=0, curRowHeight:int=0; j<_data.length; j++) {
ry += Math.round(curRowHeight/2)+vpadding; // add the last row's height plus padding
@ -219,16 +219,21 @@ package org.bigbluebutton.modules.polling.views
// add vote count in middle of rect
countText = _textFields[currTFIdx++]; // new TextField();
countText.text = _data[j].v;
countText.width = rectWidth;
countText.width = startingLabelWidth;
countText.height = curRowHeight;
countText.textColor = bgFill;
countText.selectable = false;
//addChild(countText);
findFontSize(countText, minFontSize);
countText.width = countText.textWidth+4;
countText.height = countText.textHeight+4;
countText.x = barStartX+rectWidth/2-countText.width/2;
countText.y = ry-countText.height/2;
if (countText.width > rectWidth) {
countText.x = barStartX + rectWidth + hpadding/2;
countText.textColor = colFill;
} else {
countText.x = barStartX + rectWidth/2 - countText.width/2;
countText.textColor = bgFill;
}
}
graphics.endFill();

View File

@ -84,7 +84,7 @@ package org.bigbluebutton.modules.whiteboard.business.shapes
graphics.clear();
if (_data != null && _data.length > 0) {
graphics.lineStyle(2, marginFill);
graphics.lineStyle(0, marginFill);
graphics.beginFill(marginFill, 1.0);
graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
graphics.endFill();
@ -227,7 +227,7 @@ package org.bigbluebutton.modules.whiteboard.business.shapes
// add vote count in middle of rect
countText = _textFields[currTFIdx++]; // new TextField();
countText.text = _data[j].v;
countText.width = rectWidth;
countText.width = startingLabelWidth;
countText.height = curRowHeight;
countText.textColor = bgFill;
countText.selectable = false;
@ -235,8 +235,14 @@ package org.bigbluebutton.modules.whiteboard.business.shapes
findFontSize(countText, minFontSize);
countText.width = countText.textWidth+4;
countText.height = countText.textHeight+4;
countText.x = graphX + barStartX + rectWidth/2 - countText.width/2;
countText.y = ry-countText.height/2;
if (countText.width > rectWidth) {
countText.x = barStartX + rectWidth + hpadding/2;
countText.textColor = colFill;
} else {
countText.x = barStartX + rectWidth/2 - countText.width/2;
countText.textColor = bgFill;
}
}
graphics.endFill();