|
From: Wes B. <wb...@us...> - 2007-04-19 23:04:01
|
Update of /cvsroot/synclast/client/src/com/synclast/ui In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17502 Modified Files: WordWrapLabel.java Log Message: Was not properly accounting for inset width (need to multiply by two to get both left and right sides). Index: WordWrapLabel.java =================================================================== RCS file: /cvsroot/synclast/client/src/com/synclast/ui/WordWrapLabel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WordWrapLabel.java 1 Nov 2006 23:04:03 -0000 1.3 --- WordWrapLabel.java 19 Apr 2007 23:03:57 -0000 1.4 *************** *** 21,25 **** import javax.microedition.lcdui.Font; - import javax.microedition.lcdui.Graphics; /** --- 21,24 ---- *************** *** 85,93 **** public void validate() { // If in a fixed-width container, word wrap if necessary ! if ((container.fixedW != 0) && ((x + getTotalInset() + w) > container.fixedW)) { StringBuffer buffer = new StringBuffer(originalText); ! int max = container.fixedW - getTotalInset(); // Time to wrap ! int xpos = x + getTotalInset(); int lastSpace = -1; char ch; --- 84,92 ---- public void validate() { // If in a fixed-width container, word wrap if necessary ! if ((container.fixedW != 0) && ((x + 2 * getTotalInset() + w) > container.fixedW)) { StringBuffer buffer = new StringBuffer(originalText); ! int max = container.fixedW - 2 * getTotalInset(); // Time to wrap ! int xpos = x + 2 * getTotalInset(); int lastSpace = -1; char ch; |