/[gzz]/gzz/gzz/vob/LinebreakableChain.java
ViewVC logotype

Diff of /gzz/gzz/vob/LinebreakableChain.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by benja, Sat Sep 21 16:29:19 2002 UTC revision 1.5 by benja, Sat Sep 21 16:53:34 2002 UTC
# Line 46  String rcsid = "$Id$"; Line 46  String rcsid = "$Id$";
46       * XXX Should glues also be virtual and have scale?       * XXX Should glues also be virtual and have scale?
47       * fonts scale non-uniformly, so should glue?       * fonts scale non-uniformly, so should glue?
48       */       */
49      protected int[] glues;      protected float[] glues;
   
50    
51      public void addBox(HBox box) {      public void addBox(HBox box) {
52          ensureBoxes(nboxes+1, false);          ensureBoxes(nboxes+1, false);
# Line 57  String rcsid = "$Id$"; Line 56  String rcsid = "$Id$";
56              box.setPrev(boxes[ind-1]);              box.setPrev(boxes[ind-1]);
57      }      }
58    
59      public void addGlue(int len, int str, int shr) {      public void addGlue(float len, float str, float shr) {
60          glues[nboxes*3 + GLUE_LENGTH] += len;          glues[nboxes*3 + GLUE_LENGTH] += len;
61          glues[nboxes*3 + GLUE_STRETCH] += str;          glues[nboxes*3 + GLUE_STRETCH] += str;
62          glues[nboxes*3 + GLUE_SHRINK] += shr;          glues[nboxes*3 + GLUE_SHRINK] += shr;
# Line 71  String rcsid = "$Id$"; Line 70  String rcsid = "$Id$";
70          return boxes[n];          return boxes[n];
71      }      }
72    
73      public int getGlue(int n, int property) {      public float getGlue(int n, int property) {
74          if(property < 0 || property > 2)          if(property < 0 || property > 2)
75              throw new IllegalArgumentException("illegal property: "+property);              throw new IllegalArgumentException("illegal property: "+property);
76          return glues[(n * 3) + property];          return glues[(n * 3) + property];
# Line 88  String rcsid = "$Id$"; Line 87  String rcsid = "$Id$";
87       */       */
88      void allocCopy(int n) {      void allocCopy(int n) {
89          HBox[] nboxes = new HBox[n];          HBox[] nboxes = new HBox[n];
90          int[] nglues = new int[3*(n+1)];          float[] nglues = new float[3*(n+1)];
91          if(boxes != null) {          if(boxes != null) {
92              System.arraycopy(boxes, 0, nboxes, 0, boxes.length);              System.arraycopy(boxes, 0, nboxes, 0, boxes.length);
93              System.arraycopy(glues, 0, nglues, 0, glues.length);              System.arraycopy(glues, 0, nglues, 0, glues.length);

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26