Villacaleb / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

SlimDXControl is not automatically sized to fit its parent #666

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the Direct3D9 WPF sample, SlimDXControl doesn't automatically size to
fit its parent.  This is noted in a comment in the code as a bug.  (I'm
using the latest code in SVN.)

The problem is caused by improper use of the Width and Height properties. 
If these are ever set, the control won't be sized to its parent.  They need
to remain at 0 unless set by the user of the control.  To get the size of
the control for use in setting backbuffer dimensions, use the ActualWidth
and ActualHeight properties instead.  It seems necessary to avoid
specifying alignment properties within the control as well.

With these changes, if the user of the control doesn't set the Width or
Height properties, the control is automatically sized to its parent.  If
the user sets any Width, Height, or alignment properties, these are
respected, just as they are for the CheckBox in the sample.

I've attached a patch that takes care of all this.

Original issue reported on code.google.com by tom.gran...@gmail.com on 8 May 2010 at 5:00

Attachments:

GoogleCodeExporter commented 9 years ago
Issue 666 huh? Must be an omen.

Original comment by Mike.Popoloski on 10 May 2010 at 1:51

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1610.

Original comment by promit....@gmail.com on 22 Jun 2010 at 8:37

GoogleCodeExporter commented 9 years ago
Thanks for the patch, made things pretty straightforward.

Original comment by promit....@gmail.com on 22 Jun 2010 at 8:38

GoogleCodeExporter commented 9 years ago
Cool.  Glad I could help.

Original comment by tom.gran...@gmail.com on 22 Jun 2010 at 8:42