Closed toshinagata closed 4 years ago
@toshinagata, looks good, thank you for the patch!
I have couple of questions/suggestions:
wxPolygonFillMode fillStyle = wxODDEVEN_RULE
parameter got lost from DrawLines
. Shouldn't it be added back?
(int)(points ? points->size()
uses int
, but shouldn't it be size_t
instead?
@pkulchenko, you're right. I have just pushed one more commit. Is that all right?
Sorry, one more commit. I overlooked the overridden StrokeLines().
@toshinagata, the changes look good, but I get compilation errors on Windows (gcc version 9.2.0 (Rev2, Built by MSYS2 project)
):
Scanning dependencies of target wxLuaModule
[ 2%] Building CXX object modules/luamodule/CMakeFiles/wxLuaModule.dir/luamodule.cpp.obj
In file included from .../wxlua/wxLua/modules/wxlua/wxlstate.h:14,
from .../wxlua/wxLua/modules/luamodule/luamodule.cpp:35:
.../wxlua/wxLua/modules/wxlua/wxllua.h:556:46: error: 'wxPoint2DDouble' was not declared in this scope
556 | WXDLLIMPEXP_WXLUA wxLuaSharedPtr<std::vector<wxPoint2DDouble> > LUACALL wxlua_getwxPoint2DDoubleArray(lua_State* L, int stack_idx);
| ^~~~~~~~~~~~~~~
.../wxlua/wxLua/modules/wxlua/wxllua.h:556:61: error: template argument 1 is invalid
556 | WXDLLIMPEXP_WXLUA wxLuaSharedPtr<std::vector<wxPoint2DDouble> > LUACALL wxlua_getwxPoint2DDoubleArray(lua_State* L, int stack_idx);
| ^
.../wxlua/wxLua/modules/wxlua/wxllua.h:556:61: error: template argument 2 is invalid
.../wxlua/wxLua/modules/wxlua/wxllua.h:556:63: error: template argument 1 is invalid
556 | WXDLLIMPEXP_WXLUA wxLuaSharedPtr<std::vector<wxPoint2DDouble> > LUACALL wxlua_getwxPoint2DDoubleArray(lua_State* L, int stack_idx);
| ^
make[2]: *** [modules/luamodule/CMakeFiles/wxLuaModule.dir/build.make:63: modules/luamodule/CMakeFiles/wxLuaModule.dir/luamodule.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:328: modules/luamodule/CMakeFiles/wxLuaModule.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
Error: failed to build wxLua
Do you know what may be missing?
It looks like we need #include <wx/geometry.h> somewhere. Does this patch work?
Yes, the patched worked; thank you.
DrawLines(), StrokeLines() (two variants) need an array of wxPoint2DDoubles, just like wxDC:DrawLines() needs an array of wxPoints. The arguments of these methods are modified so that they work similarly as in wxDC:DrawLines(). One of the variants of StrokeLines() needs an override, because it accepts only one 'n' (= the number of wxPoint2DDoubles) argument but two arrays of wxPoint2DDoubles.