bugfixes for ipc:graphics-setup
add xtm_paint_set_pattern
add extra max2* functions to math lib