syntax and clarification on magic number 2 as half height

This commit is contained in:
Liv 2017-07-26 13:28:52 -07:00
parent 5bd6dac66c
commit 256853f79b

View file

@ -650,7 +650,7 @@
var width = textSize.width + fudge; var width = textSize.width + fudge;
var height = speechBubbleLineHeight + fudge; var height = speechBubbleLineHeight + fudge;
if(textSize.width >= SPEECH_BUBBLE_MAX_WIDTH) { if (textSize.width >= SPEECH_BUBBLE_MAX_WIDTH) {
var numLines = Math.ceil(width); var numLines = Math.ceil(width);
height = speechBubbleLineHeight * numLines + fudge; height = speechBubbleLineHeight * numLines + fudge;
width = SPEECH_BUBBLE_MAX_WIDTH; width = SPEECH_BUBBLE_MAX_WIDTH;
@ -681,7 +681,7 @@
Vec3.sum( Vec3.sum(
headPosition, headPosition,
rotatedOffset); rotatedOffset);
position.y += height / 2; // offset based on wrapped height of bubble position.y += height / 2; // offset based on half of bubble height
speechBubbleParams.position = position; speechBubbleParams.position = position;
if (!speechBubbleTextID) { if (!speechBubbleTextID) {