Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!agate!garnet.berkeley.edu!csvsj From: csvsj@garnet.berkeley.edu (Steve Jacobson) Newsgroups: comp.graphics Subject: SunView 4.x bug? Keywords: SunView Message-ID: <1989Dec12.212651.2961@agate.berkeley.edu> Date: 12 Dec 89 21:26:51 GMT Sender: usenet@agate.berkeley.edu (USENET Administrator;;;;ZU44) Reply-To: csvsj@garnet.berkeley.edu (Steve Jacobson) Organization: University of California, Berkeley Lines: 64 The following program behaves differently in 4.x SunView than it did in 3.x Sunview: #include #include #include #include Canvas canvas; void done_proc(); main() { Frame frame; Panel panel; frame = window_create(NULL, FRAME, 0); canvas = window_create(frame, CANVAS, WIN_HEIGHT, 102, WIN_WIDTH, 102, CANVAS_WIDTH, 102, CANVAS_HEIGHT, 102, 0); panel = window_create(frame, PANEL, 0); panel_create_item(panel, PANEL_BUTTON, PANEL_LABEL_STRING, "EXIT", PANEL_NOTIFY_PROC, done_proc, 0); window_fit(panel); window_fit(frame); window_main_loop(frame); } void done_proc(item, event) Panel_item item; Event *event; { Pixwin *pw; Pixrect *pr; struct mpr_data *d; pw = canvas_pixwin(canvas); pr = pw->pw_prretained; d = mpr_d(pr); printf("width = %d linebytes = %d\n", pr->pr_size.x, d->md_linebytes); exit(); } Under SunView 4.x, the program outputs "width = 102 linebytes = 16" when the "EXIT" button is selected. Under SunView 3.x, the program outputs "width = 102 linebytes = 14". Apparently, under SunView 4.x, the pixrect data for the canvas pixwin's retained pixrect is padded to a 32 bit boundary for each row, rather than a 16 bit boundary. The documentation in the Pixrect Reference Manual says that data for memory pixrect rows are rounded up to 16-bit boundaries. So is this behavior a bug, or what?