SWT - ¿Puedo hacer crecer y encoger mi lienzo según el tamaño del dibujo?

I have an SWT Composite within a ScrolledComposite and I am currently drawing to the Composite control.

The size of my drawing is variable so I would like the size of the Composite control to increase and decrease based on what is drawn. I already have the width and height of my drawing but can't call setSize on the Composite or else it will case a repaint (and will get stuck in a loop).

¿Alguien tiene alguna sugerencia?

Gracias, alan

preguntado el 08 de noviembre de 11 a las 11:11

1 Respuestas

OK, I solved it myself.

As I mentioned in my question, I could already work out the width and height AFTER the drawing has taken place. So, I re-factored that code so that it could also be called before I actually do the drawing. This way I can pass in an in-memory GC and return the dimensions.

Alan

respondido 08 nov., 11:19

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.