[haiku-3rdparty-dev] Re: GetHeightForWidth

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Sat, 02 Jul 2011 16:59:16 +0200

On 2011-07-02 at 12:44:13 [+0200], ciprian.nedisan@xxxxxxxxxxxx wrote:
> How does View::GetHeightForWidth   work?
> I was hoping that I could enforce a fixed Hight/Width = 1
> proportion.
> I tried the following:
> 
> bool
> ChessBoardView::HasHeightForWidth()
> {
>     return true;
> }
> 
> void
> ChessBoardView::GetHeightForWidth(float width, float* min, float*
> max, float* preferred)
> {
>     *min = width;
>     *max = width;
>     *preferred = width;
> }
> 
> but that crashes the application.

Any of the min, max, and preferred pointer arguments can be NULL. The 
caller only asks for the values it needs.

CU, Ingo

Other related posts: