Commit 032a0a7b authored by kollo's avatar kollo

fixed Johns issue (2018-04-03) PBOX/Android

Added comments for thick line end points issue
fixed also PRBOX
parent 2a95b6d1
......@@ -146,7 +146,14 @@ DESCRIPTION:
7 Long Dash dot dot ..
0x11-0xffffffff User defined (not used)
<thickness> -- sets line width in pixels.
<thickness> -- sets line width in pixels. A thickness greater than or equal to
1 is considered a wide line, and the value 0 is a special case,
considered a thin line. Wide and thin lines use different drawing
algorithms. Styles and different start and end symbols are only
possible for wide lines. Also it is possible that the last point
of the line is treated differently, meaning, sometimes it is not
drawn with wide lines.
<begin_s>,<end_s> -- The start and end symbols are defined
by the last parameter, and can be:
0 Square
......
......@@ -10,6 +10,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
......@@ -173,7 +174,6 @@ void FB_restorecontext() {
screen.graphmode=backup.graphmode;
screen.textmode=backup.textmode;
screen.linewidth=backup.linewidth;
screen.linewidth=backup.linewidth;
screen.fill_rule=backup.fill_rule;
screen.fill_style=backup.fill_style;
screen.fill_pat=backup.fill_pat;
......@@ -190,7 +190,7 @@ void FB_defaultcontext() {
screen.mousepat=(unsigned short *)mousepat;
screen.alpha=255;
screen.graphmode=1;
screen.linewidth=1;
screen.linewidth=0; /* 0 means thin lines */
screen.fill_rule=0;
screen.fill_style=0;
screen.fill_pat=NULL;
......@@ -518,7 +518,7 @@ void FB_DrawThickLine(int x0, int y0, int x1, int y1,int width, unsigned short c
}
static void FB_doline(int x1,int y1,int x2,int y2) {
if(screen.linewidth>1) FB_DrawThickLine(x1,y1,x2,y2,screen.linewidth, screen.fcolor);
if(screen.linewidth) FB_DrawThickLine(x1,y1,x2,y2,screen.linewidth, screen.fcolor);
else {
if(y1==y2) {
if(x2>=x1) DrawHorizontalLine(x1,y1,x2-x1,screen.fcolor);
......@@ -582,6 +582,8 @@ void FB_box(int x1,int y1,int x2,int y2) {
void FillBox (int x, int y, int w, int h, unsigned short color) {
int i;
// printf("fillbox w=%d\n",w);
if(w<=0 || h<=0) return;
for (i=y; i<y+h; i++) {
if(screen.fill_pat && screen.fill_style==FillStippled) {
if(screen.graphmode<=1) DrawHorizontalLinePattBg(x,i,w,color,screen.bcolor,*((unsigned short *)(screen.fill_pat+(i&0xf))));
......
......@@ -597,6 +597,8 @@ void c_pbox(PARAMETER *plist,int e) {
a[2]=plist[2].integer;
a[3]=plist[3].integer;
v_bar(window[usewindow].vdi_handle,a);
#elif defined FRAMEBUFFER
FB_pbox(plist[0].integer,plist[1].integer,plist[2].integer,plist[3].integer);
#else
pbox(plist[0].integer,plist[1].integer,plist[2].integer,plist[3].integer);
#endif
......@@ -610,6 +612,13 @@ void c_prbox(PARAMETER *plist,int e) {
a[2]=plist[2].integer;
a[3]=plist[3].integer;
v_rfbox(window[usewindow].vdi_handle,a);
#elif defined FRAMEBUFFER
FB_pbox(plist[0].integer+RBOX_RADIUS,plist[1].integer,plist[2].integer-RBOX_RADIUS,plist[3].integer);
FB_pbox(plist[0].integer,plist[1].integer+RBOX_RADIUS,plist[2].integer,plist[3].integer-RBOX_RADIUS);
FB_pArc(plist[0].integer,plist[1].integer,2*RBOX_RADIUS,2*RBOX_RADIUS,90*64,90*64);
FB_pArc(plist[2].integer-2*RBOX_RADIUS,plist[1].integer,2*RBOX_RADIUS,2*RBOX_RADIUS,0,90*64);
FB_pArc(plist[2].integer-2*RBOX_RADIUS,plist[3].integer-2*RBOX_RADIUS,2*RBOX_RADIUS,2*RBOX_RADIUS,270*64,90*64);
FB_pArc(plist[0].integer,plist[3].integer-2*RBOX_RADIUS,2*RBOX_RADIUS,2*RBOX_RADIUS,180*64,90*64);
#else
pbox(plist[0].integer+RBOX_RADIUS,plist[1].integer,plist[2].integer-RBOX_RADIUS,plist[3].integer);
pbox(plist[0].integer,plist[1].integer+RBOX_RADIUS,plist[2].integer,plist[3].integer-RBOX_RADIUS);
......@@ -1031,6 +1040,9 @@ void c_clip(PARAMETER *plist,int e) {
}
#endif
}
/* TODO: The implementation of DEFLINE other than on X11 is incomplete.*/
void c_defline(PARAMETER *plist,int e) {
graphics();
#ifdef FRAMEBUFFER
......@@ -1039,7 +1051,7 @@ void c_defline(PARAMETER *plist,int e) {
if(e>=3 && plist[2].typ!=PL_LEER) screen.linecap=plist[2].integer;
if(e>=4 && plist[3].typ!=PL_LEER) screen.linejoin=plist[3].integer;
#elif defined USE_X11
static int style=0,width=0,cap=0,join=0;
static int style=0,width=0,cap=CapButt,join=JoinMiter;
if(e>=1 && plist[0].typ!=PL_LEER) style=plist[0].integer;
if(e>=2 && plist[1].typ!=PL_LEER) width=plist[1].integer;
if(e>=3 && plist[2].typ!=PL_LEER) cap=plist[2].integer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment