Mercurial > dwindows
comparison android/dw.cpp @ 2537:cd9d2ba251d5
Android: Reimplement drawPolygon() using drawPath() instead of drawLines/Points().
Add some extra safety checks before calling into drawPolygon().
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 11 May 2021 22:44:45 +0000 |
parents | d862d9e4069b |
children | 822f814a54f4 |
comparison
equal
deleted
inserted
replaced
2536:d172ab2eddb6 | 2537:cd9d2ba251d5 |
---|---|
2580 */ | 2580 */ |
2581 void API dw_draw_polygon(HWND handle, HPIXMAP pixmap, int flags, int npoints, int *x, int *y) | 2581 void API dw_draw_polygon(HWND handle, HPIXMAP pixmap, int flags, int npoints, int *x, int *y) |
2582 { | 2582 { |
2583 JNIEnv *env; | 2583 JNIEnv *env; |
2584 | 2584 |
2585 if((handle || pixmap) && (env = (JNIEnv *)pthread_getspecific(_dw_env_key))) | 2585 if((handle || pixmap) && npoints > 0 && x && y && (env = (JNIEnv *)pthread_getspecific(_dw_env_key))) |
2586 { | 2586 { |
2587 jintArray jx = env->NewIntArray(npoints); | 2587 jintArray jx = env->NewIntArray(npoints); |
2588 jintArray jy = env->NewIntArray(npoints); | 2588 jintArray jy = env->NewIntArray(npoints); |
2589 | 2589 |
2590 if(jx && jy) | 2590 if(jx && jy) |