text not showing correctly in IE

24 views
Skip to first unread message

Jorge

unread,
Mar 12, 2011, 4:37:43 PM3/12/11
to GWT Graphics
Hi!

I'm having some problems wih my application in IE. When I click a
button and cursor is moved to the canvas, the element appears under
cursor and moves with it. The element is a class that extends Group
and is compound by a Rectangle and a Text on top of it.

The problem is that text is not showing until I stop moving the
cursor. After that, its always visible, even while moving the cursor.

In firefox or chrome works ok.

Any idea about why is this happening?

Thanks and regards,

Jorge

Henri Kerola

unread,
Apr 3, 2011, 2:40:16 PM4/3/11
to gwt-gr...@googlegroups.com
Hi,

Do you have a simple test app that shows the behaviour?

Nagin Kothari

unread,
Apr 5, 2011, 4:15:45 AM4/5/11
to gwt-gr...@googlegroups.com, Henri Kerola
Hi Henri,

You can reproduce this behavior in the following test application you have created

http://hene.virtuallypreinstalled.com/gwt-graphics-test/

In this example add Text with "Arial" font and add Text in "Times new roman". In IE both look same(the font name effect does not work), while in Firefox it works correctly.

regards,

Nagin

Jorge

unread,
Apr 5, 2011, 5:05:27 AM4/5/11
to GWT Graphics
Hi,

What Nagin says is not the problem I'm having. My problem is that the
text is not showing at all. Is ther any way I send you a video to show
you the behavior I'm having?

This is how I create the object and how I move it when cursor moves:

private String backgroundColor = "white";
private static final int WEST_MARGIN = 15;
private static final int EAST_MARGIN = 15;
private static final int SOUTH_MARGIN = 15;
private static final int RECTANGLE_STROKE_WIDTH = 2;
private static final int RECTANGLE_CORNERS_RADIUS = 10;
private static final int CONNECT_PANEL_HEIGHT = 15;
private static final int CONNECT_PANEL_WIDTH = 15;
private static final int CONNECT_PANEL_X_RELATION = 10;
private static final int CONNECT_PANEL_Y_RELATION = -
CONNECT_PANEL_HEIGHT - RECTANGLE_STROKE_WIDTH;
private static final int CONNECT_PANEL_MARGIN = 2;
private Text text;
protected Rectangle rectangle;
protected DrawingArea canvas;

public SVGElement(DrawingArea canvas, String name, int x, int y,
String backgroundColor) {
super();
this.canvas = canvas;
this.text = new Text(x + WEST_MARGIN, y, name);
this.text.setStrokeColor("black");
this.text.setFontSize(50);
this.text.setFillColor("black");
this.backgroundColor = backgroundColor;

int rectangleWidth = WEST_MARGIN + this.text.getTextWidth() +
EAST_MARGIN;
int rectangleHeight = this.text.getTextHeight();
this.rectangle = new Rectangle(x, y, rectangleWidth,
rectangleHeight);
this.rectangle.setStrokeColor("black");
this.rectangle.setFillColor(this.backgroundColor);
this.rectangle.setStrokeWidth(RECTANGLE_STROKE_WIDTH);
this.rectangle.setRoundedCorners(RECTANGLE_CORNERS_RADIUS);
//reposition text because y coordinate is left-down corner for
text instead of left-up
this.text.setY(y + rectangleHeight - SOUTH_MARGIN);

this.add(this.rectangle);
this.add(this.text);
this.canvas.add(this);
this.startConnectionPanelsAnimation();
}

public void move(Movement movement) {
int newX = this.rectangle.getX() + movement.getHComponent();
int newY = this.rectangle.getY() + movement.getVComponent();
this.mashupElement.setLeft(new Integer(newX));
this.mashupElement.setTop(new Integer(newY));
this.rectangle.setX(newX);
this.rectangle.setY(newY);
this.text.setX(this.text.getX() + movement.getHComponent());
this.text.setY(this.text.getY() + movement.getVComponent());
}

Thanks,

Jorge
Reply all
Reply to author
Forward
0 new messages