From 953ee650a80d863a85c99e82ef69501496db0ad6 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Thu, 16 Feb 2012 13:55:08 +0100 Subject: [wx] Fix wxGraphicContext bugs * Lines had wrong arguments * Change float() to number in guards, when packing arguments integers are converted floats to automaticly anyway. --- lib/wx/api_gen/wx_gen_cpp.erl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/wx/api_gen/wx_gen_cpp.erl') diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl index 1b4c32db24..4bc58533ad 100644 --- a/lib/wx/api_gen/wx_gen_cpp.erl +++ b/lib/wx/api_gen/wx_gen_cpp.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2011. All Rights Reserved. +%% Copyright Ericsson AB 2008-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -645,6 +645,16 @@ decode_arg(N,#type{name=Type,single=list,base={class,Class}},arg,A0) -> w(" ~s.Append(*(~s *) getPtr(bp,memenv)); bp += 4;}~n", [N,Class]), w(" bp += ((~p+ *~sLen)%2 )*4;~n", [A,N]), 0; +decode_arg(N,#type{single=array,base={comp,Class="wxPoint2DDouble",_}},arg,A0) -> + w(" int * ~sLen = (int *) bp; bp += 4;~n", [N]), + w(" ~s *~s;~n",[Class,N]), + w(" ~s = (~s *) driver_alloc(sizeof(~s) * *~sLen);~n",[N,Class,Class,N]), + store_free(N), + align(A0+1,64), + w(" for(int i=0; i < *~sLen; i++) {~n", [N]), + w(" double x = * (double *) bp; bp += 8;~n double y = * (double *) bp; bp += 8;~n", []), + w(" ~s[i] = wxPoint2DDouble(x,y);}~n", [N]), + 0; decode_arg(Name,T, Arg,_A) -> ?error({unhandled_type, {Name,T, Arg}}). -- cgit v1.2.3