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/src/gen/wxGraphicsPath.erl | 62 +++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'lib/wx/src/gen/wxGraphicsPath.erl') diff --git a/lib/wx/src/gen/wxGraphicsPath.erl b/lib/wx/src/gen/wxGraphicsPath.erl index 6e9af755b9..32e9685895 100644 --- a/lib/wx/src/gen/wxGraphicsPath.erl +++ b/lib/wx/src/gen/wxGraphicsPath.erl @@ -49,49 +49,49 @@ moveToPoint(#wx_ref{type=ThisT,ref=ThisRef},{PX,PY}) when is_number(PX),is_number(PY) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_MoveToPoint_1, - <>). + <>). %% @doc See external documentation. -spec moveToPoint(This, X, Y) -> ok when - This::wxGraphicsPath(), X::float(), Y::float(). + This::wxGraphicsPath(), X::number(), Y::number(). moveToPoint(#wx_ref{type=ThisT,ref=ThisRef},X,Y) - when is_float(X),is_float(Y) -> + when is_number(X),is_number(Y) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_MoveToPoint_2, <>). %% @doc See external documentation. -spec addArc(This, C, R, StartAngle, EndAngle, Clockwise) -> ok when - This::wxGraphicsPath(), C::{X::float(), Y::float()}, R::float(), StartAngle::float(), EndAngle::float(), Clockwise::boolean(). + This::wxGraphicsPath(), C::{X::float(), Y::float()}, R::number(), StartAngle::number(), EndAngle::number(), Clockwise::boolean(). addArc(#wx_ref{type=ThisT,ref=ThisRef},{CX,CY},R,StartAngle,EndAngle,Clockwise) - when is_number(CX),is_number(CY),is_float(R),is_float(StartAngle),is_float(EndAngle),is_boolean(Clockwise) -> + when is_number(CX),is_number(CY),is_number(R),is_number(StartAngle),is_number(EndAngle),is_boolean(Clockwise) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_AddArc_5, - <>). + <>). %% @doc See external documentation. -spec addArc(This, X, Y, R, StartAngle, EndAngle, Clockwise) -> ok when - This::wxGraphicsPath(), X::float(), Y::float(), R::float(), StartAngle::float(), EndAngle::float(), Clockwise::boolean(). + This::wxGraphicsPath(), X::number(), Y::number(), R::number(), StartAngle::number(), EndAngle::number(), Clockwise::boolean(). addArc(#wx_ref{type=ThisT,ref=ThisRef},X,Y,R,StartAngle,EndAngle,Clockwise) - when is_float(X),is_float(Y),is_float(R),is_float(StartAngle),is_float(EndAngle),is_boolean(Clockwise) -> + when is_number(X),is_number(Y),is_number(R),is_number(StartAngle),is_number(EndAngle),is_boolean(Clockwise) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_AddArc_6, <>). %% @doc See external documentation. -spec addArcToPoint(This, X1, Y1, X2, Y2, R) -> ok when - This::wxGraphicsPath(), X1::float(), Y1::float(), X2::float(), Y2::float(), R::float(). + This::wxGraphicsPath(), X1::number(), Y1::number(), X2::number(), Y2::number(), R::number(). addArcToPoint(#wx_ref{type=ThisT,ref=ThisRef},X1,Y1,X2,Y2,R) - when is_float(X1),is_float(Y1),is_float(X2),is_float(Y2),is_float(R) -> + when is_number(X1),is_number(Y1),is_number(X2),is_number(Y2),is_number(R) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_AddArcToPoint, <>). %% @doc See external documentation. -spec addCircle(This, X, Y, R) -> ok when - This::wxGraphicsPath(), X::float(), Y::float(), R::float(). + This::wxGraphicsPath(), X::number(), Y::number(), R::number(). addCircle(#wx_ref{type=ThisT,ref=ThisRef},X,Y,R) - when is_float(X),is_float(Y),is_float(R) -> + when is_number(X),is_number(Y),is_number(R) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_AddCircle, <>). @@ -103,22 +103,22 @@ addCurveToPoint(#wx_ref{type=ThisT,ref=ThisRef},{C1X,C1Y},{C2X,C2Y},{EX,EY}) when is_number(C1X),is_number(C1Y),is_number(C2X),is_number(C2Y),is_number(EX),is_number(EY) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_AddCurveToPoint_3, - <>). + <>). %% @doc See external documentation. -spec addCurveToPoint(This, Cx1, Cy1, Cx2, Cy2, X, Y) -> ok when - This::wxGraphicsPath(), Cx1::float(), Cy1::float(), Cx2::float(), Cy2::float(), X::float(), Y::float(). + This::wxGraphicsPath(), Cx1::number(), Cy1::number(), Cx2::number(), Cy2::number(), X::number(), Y::number(). addCurveToPoint(#wx_ref{type=ThisT,ref=ThisRef},Cx1,Cy1,Cx2,Cy2,X,Y) - when is_float(Cx1),is_float(Cy1),is_float(Cx2),is_float(Cy2),is_float(X),is_float(Y) -> + when is_number(Cx1),is_number(Cy1),is_number(Cx2),is_number(Cy2),is_number(X),is_number(Y) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_AddCurveToPoint_6, <>). %% @doc See external documentation. -spec addEllipse(This, X, Y, W, H) -> ok when - This::wxGraphicsPath(), X::float(), Y::float(), W::float(), H::float(). + This::wxGraphicsPath(), X::number(), Y::number(), W::number(), H::number(). addEllipse(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H) - when is_float(X),is_float(Y),is_float(W),is_float(H) -> + when is_number(X),is_number(Y),is_number(W),is_number(H) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_AddEllipse, <>). @@ -130,13 +130,13 @@ addLineToPoint(#wx_ref{type=ThisT,ref=ThisRef},{PX,PY}) when is_number(PX),is_number(PY) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_AddLineToPoint_1, - <>). + <>). %% @doc See external documentation. -spec addLineToPoint(This, X, Y) -> ok when - This::wxGraphicsPath(), X::float(), Y::float(). + This::wxGraphicsPath(), X::number(), Y::number(). addLineToPoint(#wx_ref{type=ThisT,ref=ThisRef},X,Y) - when is_float(X),is_float(Y) -> + when is_number(X),is_number(Y) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_AddLineToPoint_2, <>). @@ -152,27 +152,27 @@ addPath(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PathT,ref=PathRef}) -> %% @doc See external documentation. -spec addQuadCurveToPoint(This, Cx, Cy, X, Y) -> ok when - This::wxGraphicsPath(), Cx::float(), Cy::float(), X::float(), Y::float(). + This::wxGraphicsPath(), Cx::number(), Cy::number(), X::number(), Y::number(). addQuadCurveToPoint(#wx_ref{type=ThisT,ref=ThisRef},Cx,Cy,X,Y) - when is_float(Cx),is_float(Cy),is_float(X),is_float(Y) -> + when is_number(Cx),is_number(Cy),is_number(X),is_number(Y) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_AddQuadCurveToPoint, <>). %% @doc See external documentation. -spec addRectangle(This, X, Y, W, H) -> ok when - This::wxGraphicsPath(), X::float(), Y::float(), W::float(), H::float(). + This::wxGraphicsPath(), X::number(), Y::number(), W::number(), H::number(). addRectangle(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H) - when is_float(X),is_float(Y),is_float(W),is_float(H) -> + when is_number(X),is_number(Y),is_number(W),is_number(H) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_AddRectangle, <>). %% @doc See external documentation. -spec addRoundedRectangle(This, X, Y, W, H, Radius) -> ok when - This::wxGraphicsPath(), X::float(), Y::float(), W::float(), H::float(), Radius::float(). + This::wxGraphicsPath(), X::number(), Y::number(), W::number(), H::number(), Radius::number(). addRoundedRectangle(#wx_ref{type=ThisT,ref=ThisRef},X,Y,W,H,Radius) - when is_float(X),is_float(Y),is_float(W),is_float(H),is_float(Radius) -> + when is_number(X),is_number(Y),is_number(W),is_number(H),is_number(Radius) -> ?CLASS(ThisT,wxGraphicsPath), wxe_util:cast(?wxGraphicsPath_AddRoundedRectangle, <>). @@ -195,13 +195,13 @@ contains(This,C={CX,CY}) %% @doc See external documentation. -spec contains(This, X, Y) -> boolean() when - This::wxGraphicsPath(), X::float(), Y::float(); + This::wxGraphicsPath(), X::number(), Y::number(); (This, C, [Option]) -> boolean() when This::wxGraphicsPath(), C::{X::float(), Y::float()}, Option :: {fillStyle, integer()}. contains(This,X,Y) - when is_record(This, wx_ref),is_float(X),is_float(Y) -> + when is_record(This, wx_ref),is_number(X),is_number(Y) -> contains(This,X,Y, []); contains(#wx_ref{type=ThisT,ref=ThisRef},{CX,CY}, Options) when is_number(CX),is_number(CY),is_list(Options) -> @@ -210,14 +210,14 @@ contains(#wx_ref{type=ThisT,ref=ThisRef},{CX,CY}, Options) (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)), wxe_util:call(?wxGraphicsPath_Contains_2, - <>). + <>). %% @doc See external documentation. -spec contains(This, X, Y, [Option]) -> boolean() when - This::wxGraphicsPath(), X::float(), Y::float(), + This::wxGraphicsPath(), X::number(), Y::number(), Option :: {fillStyle, integer()}. contains(#wx_ref{type=ThisT,ref=ThisRef},X,Y, Options) - when is_float(X),is_float(Y),is_list(Options) -> + when is_number(X),is_number(Y),is_list(Options) -> ?CLASS(ThisT,wxGraphicsPath), MOpts = fun({fillStyle, FillStyle}, Acc) -> [<<1:32/?UI,FillStyle:32/?UI>>|Acc]; (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, -- cgit v1.2.3