Update of /cvsroot/freenet/freenet/src/freenet/support/graph
In directory sc8-pr-cvs1:/tmp/cvs-serv22541/src/freenet/support/graph
Modified Files:
Bitmap.java
Log Message:
Initialize bitmaps with proper viewport (a viewport of (0,0,1,1) isn't of much use for
anything).
Draw estimator lines with lines instead of with dots.
Modify bitmap viewport scale calculation to enable drawing to (0,Y).
Fix bug in OCM PeerHandler HTML causing duplicate rendering of 'Transfer rate
(min/max) Xbytes/second/Xbytes/second' section on max detail level.
Darker colors in the PeerHandler HTML routing graphs. Easier to read and better for
flux lines drawing.
Index: Bitmap.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/support/graph/Bitmap.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -r1.6 -r1.7
--- Bitmap.java 29 Oct 2003 23:06:55 -0000 1.6
+++ Bitmap.java 4 Nov 2003 12:32:11 -0000 1.7
@@ -24,7 +24,7 @@
pixels = null;
pallette = null;
- coord = new Rectangle(0, 0, 1, 1);
+ coord = new Rectangle(0, 0, width, height);
x = 0;
y = 0;
@@ -171,6 +171,10 @@
coord = r;
}
+ //Resets the view to represent all of the bitmap
+ public void resetScaleView(){
+ scaleView(new Rectangle(0,0,getWidth(),getHeight()));
+ }
/**
* Convert from a point in user-coordinates to a point on the pixel array. use
Math.round() on the result to get the actual offset into pixels. happily returns
values outside the view box.
@@ -178,11 +182,11 @@
* Be sure to clip based on the rounded result; -0.4 is inside the view box,
-0.6 is not.
*/
private float xPix(float xu) {
- return ((xu - coord.left) / (coord.left - coord.right)) * (0.5f -
(float) width) + 0.5f;
+ return ((xu - coord.left) / (coord.left - coord.right)) * (0.5f -
(float) width) + 0.49f;
}
private float yPix(float yu) {
- return ((yu - coord.top) / (coord.top - coord.bottom)) * (0.5f -
(float) height) + 0.5f;
+ return ((yu - coord.top) / (coord.top - coord.bottom)) * (0.5f -
(float) height) + 0.49f;
}
byte[][] getPixels() {
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs