75 |
|
|
76 |
public void getSize(Cell c, float scale, ViewContext context, |
public void getSize(Cell c, float scale, ViewContext context, |
77 |
float[] out) { |
float[] out) { |
78 |
String s; |
float w = style.getWidth(widthString, scale); |
|
if(c != null) |
|
|
s = Containment.getContainedText(c); |
|
|
else |
|
|
s = widthString; |
|
|
|
|
|
/** |
|
|
* Width of LinebrokenCellContentView is the |
|
|
* width of its longest line. |
|
|
*/ |
|
|
float w = style.getWidth(s, scale); |
|
|
int linebreak = s.indexOf('\n'); |
|
|
if (linebreak != -1) { |
|
|
w = style.getWidth(s.substring(0, linebreak), scale); |
|
|
int anotherLinebreak = s.indexOf('\n', linebreak+1); |
|
|
while (anotherLinebreak != -1) { |
|
|
float anotherWidth = style.getWidth(s.substring(linebreak+1, anotherLinebreak), scale); |
|
|
if (w < anotherWidth) w = anotherWidth; |
|
|
linebreak = anotherLinebreak; |
|
|
anotherLinebreak = s.indexOf('\n', linebreak+1); |
|
|
} |
|
|
float anotherWidth = style.getWidth(s.substring(linebreak+1, s.length()), scale); |
|
|
if (w < anotherWidth) w = anotherWidth; |
|
|
} |
|
|
|
|
79 |
float h; |
float h; |
80 |
if(c != null) |
if(c != null) |
81 |
h = getHeight(c, w, scale); |
h = getHeight(c, w, scale); |