finished debugging parameter error, now test drawing without resetting clip
This commit is contained in:
parent
12bd14e1e7
commit
3dd2e037ff
|
@ -1,21 +1,18 @@
|
||||||
# Test of line clipping
|
# Test of line clipping
|
||||||
import upiwin
|
import upiwin
|
||||||
|
|
||||||
print('**GOT HERE 1')
|
|
||||||
hdc = upiwin.DevCtxt(type='screen')
|
hdc = upiwin.DevCtxt(type='screen')
|
||||||
print('**GOT HERE 2')
|
|
||||||
hdc.text_color = 0xFFFFFF # white
|
hdc.text_color = 0xFFFFFF # white
|
||||||
hdc.rectangle(100, 100, 199, 199)
|
hdc.rectangle(100, 100, 199, 199)
|
||||||
print('**GOT HERE 3')
|
|
||||||
|
|
||||||
clip = hdc.get_clip_rect()
|
#clip = hdc.get_clip_rect()
|
||||||
hdc.set_clip_rect(100, 100, 200, 200)
|
#hdc.set_clip_rect(100, 100, 200, 200)
|
||||||
|
|
||||||
hdc.text_color = 0xFF0000 # red
|
hdc.text_color = 0xFF0000 # red
|
||||||
hdc.move_to(0, 200)
|
hdc.move_to(0, 200)
|
||||||
hdc.line_to(200, 0)
|
hdc.line_to(200, 0)
|
||||||
|
|
||||||
hdc.set_clip_rect(clip[0], clip[1], clip[2], clip[3])
|
#hdc.set_clip_rect(clip[0], clip[1], clip[2], clip[3])
|
||||||
|
|
||||||
msg = {}
|
msg = {}
|
||||||
while upiwin.get_message(msg):
|
while upiwin.get_message(msg):
|
||||||
|
|
|
@ -207,13 +207,10 @@ static int devctxt_init(DevCtxtObject *self, PyObject *args, PyObject *kwds)
|
||||||
static char *kwlist[] = { "type", NULL };
|
static char *kwlist[] = { "type", NULL };
|
||||||
const char *type;
|
const char *type;
|
||||||
|
|
||||||
Log(LDEBUG, "Creating a new DevCtxt object");
|
|
||||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "$s", kwlist, &type))
|
if (!PyArg_ParseTupleAndKeywords(args, kwds, "$s", kwlist, &type))
|
||||||
return -1;
|
return -1;
|
||||||
Log(LDEBUG,"type argument is '%s'", type);
|
|
||||||
if (strcmp(type, "screen") == 0)
|
if (strcmp(type, "screen") == 0)
|
||||||
{
|
{
|
||||||
Log(LDEBUG, "doing what we expect on screen context");
|
|
||||||
self->pdctxt = DC_CreateScreenContext();
|
self->pdctxt = DC_CreateScreenContext();
|
||||||
if (!(self->pdctxt))
|
if (!(self->pdctxt))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user