[TeamTalk 40]: [577] TeamTalk/Agents/PenDecoder/src/edu/cmu/ravenclaw/pendecoder: Bug: zoom-in reverts to full screen at next refresh in virtual environment: fixed
tk@edam.speech.cs.cmu.edu
tk at edam.speech.cs.cmu.edu
Mon Apr 16 12:17:09 EDT 2007
An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20070416/c169caa6/attachment.html
-------------- next part --------------
Modified: TeamTalk/Agents/PenDecoder/src/edu/cmu/ravenclaw/pendecoder/DrawingPad.java
===================================================================
--- TeamTalk/Agents/PenDecoder/src/edu/cmu/ravenclaw/pendecoder/DrawingPad.java 2007-04-13 21:15:12 UTC (rev 576)
+++ TeamTalk/Agents/PenDecoder/src/edu/cmu/ravenclaw/pendecoder/DrawingPad.java 2007-04-16 16:17:08 UTC (rev 577)
@@ -97,7 +97,6 @@
public void mapUpdate(int type, int x_dim, int y_dim, float x_origin, float y_origin, int resolution, int[] encoded_map) {
canvas.mapUpdate(type, x_dim, y_dim, x_origin, y_origin, resolution, encoded_map);
- //if(type == MapBufferedImage.FULL) drawingCanvas.zoomOut();
}
public void addServer(PenDecoderServer server) {
Modified: TeamTalk/Agents/PenDecoder/src/edu/cmu/ravenclaw/pendecoder/scribble3/ScribbleCanvas.java
===================================================================
--- TeamTalk/Agents/PenDecoder/src/edu/cmu/ravenclaw/pendecoder/scribble3/ScribbleCanvas.java 2007-04-13 21:15:12 UTC (rev 576)
+++ TeamTalk/Agents/PenDecoder/src/edu/cmu/ravenclaw/pendecoder/scribble3/ScribbleCanvas.java 2007-04-16 16:17:08 UTC (rev 577)
@@ -164,23 +164,9 @@
public void mapUpdate(int type, int x_dim, int y_dim, float x_origin, float y_origin, int resolution, int[] encoded_map) {
byte[] decoded_map = new byte[x_dim*y_dim];
decodeMap(decoded_map, x_dim, y_dim, encoded_map);
- /*
- for(int j=0; j<y_dim; j++) {
- for(int i=0; i<x_dim; i++) System.err.print(decoded_map[j*x_dim+i]);
- System.err.println();
- }
- */
if(type == MapBufferedImage.FULL) {
- backImage = MapBufferedImage.createMapBufferedImage(x_dim, y_dim);
- native_width = x_dim*resolution;
- native_height = y_dim*resolution;
- this.x_origin = x_origin*100;
- this.y_origin = y_origin*100;
- image_width_in_pixels = x_dim;
- image_height_in_pixels = y_dim;
- backImage.setFullMap(decoded_map);
-
- { //build the hashmarks
+ if(image_width_in_pixels != x_dim || image_height_in_pixels != y_dim) {
+ //build the hashmarks & zoom out
int colors[] = new int[3];
colors[1] = Color.BLACK.getRGB();
colors[2] = Color.DARK_GRAY.getRGB();
@@ -195,10 +181,16 @@
else wr.setSample(i, j, 0, 1);
}
}
+ setPreferredSize(new Dimension(x_dim, y_dim));
}
- setPreferredSize(new Dimension((int)image_width_in_pixels,
- (int)image_height_in_pixels));
-
+ backImage = MapBufferedImage.createMapBufferedImage(x_dim, y_dim);
+ native_width = x_dim*resolution;
+ native_height = y_dim*resolution;
+ this.x_origin = x_origin*100;
+ this.y_origin = y_origin*100;
+ image_width_in_pixels = x_dim;
+ image_height_in_pixels = y_dim;
+ backImage.setFullMap(decoded_map);
repaint();
} else if(type == MapBufferedImage.DIFF) { //diff map
if(x_dim != image_width_in_pixels || y_dim != image_height_in_pixels) {
More information about the TeamTalk-developers
mailing list