|
@@ -497,8 +497,33 @@ void cmGrDcDrawTextJustifyPt( cmGrDcH_t h, unsigned fontId, unsigned size, un
|
497
|
497
|
else
|
498
|
498
|
y = yy + sz.h/2;
|
499
|
499
|
|
500
|
|
- cmGrDcDrawText(h, text, x+.5, y+.5 );
|
501
|
500
|
|
|
501
|
+
|
|
502
|
+ cmGrPExt_t r;
|
|
503
|
+ cmGrPExtSet(&r,x,y,sz.w,sz.h);
|
|
504
|
+
|
|
505
|
+ // Note: Checking for visibility should not be necessary however
|
|
506
|
+ // there appears to be a problem with the FLTK text output whereby
|
|
507
|
+ // text coordinates over 0xffff wrap around and may appear in the
|
|
508
|
+ // visible region.
|
|
509
|
+ if( cmGrDcRectIsVisible(h,&r) )
|
|
510
|
+ {
|
|
511
|
+ /*
|
|
512
|
+ if( text!=NULL && (strncmp(text,"loc:138",7)==0 || strcmp(text,"loc:8 ")==0))
|
|
513
|
+ {
|
|
514
|
+ printf("%s %i %i %i %i\n",text,x,y,sz.w,xx);
|
|
515
|
+ cmGrPExtPrint(text,&r);
|
|
516
|
+ cmGrDc_t* p = _cmGrDcHandleToPtr(h);
|
|
517
|
+ cmGrPExt_t res;
|
|
518
|
+ cmGrPExtIntersect(&res,&p->pext,&r );
|
|
519
|
+ cmGrPExtPrint(text,&p->pext);
|
|
520
|
+ cmGrPExtPrint("isect:",&res);
|
|
521
|
+ printf("%i\n",cmGrPExtIsNotNullOrEmpty(&res));
|
|
522
|
+ }
|
|
523
|
+ */
|
|
524
|
+
|
|
525
|
+ cmGrDcDrawText(h, text, x+.5, y+.5 );
|
|
526
|
+ }
|
502
|
527
|
//cmGrPExt_t pext;
|
503
|
528
|
//cmGrDcDrawTextJustifyRect(h, fontId, size, style, text, flags, xx, yy, &pext );
|
504
|
529
|
//cmGrDcDrawRectPExt(h,&pext);
|
|
@@ -528,3 +553,17 @@ void cmGrDcDrawTextJustifyRect( cmGrDcH_t h, unsigned fontId, unsigned size, u
|
528
|
553
|
|
529
|
554
|
cmGrPExtSet( pext, x, y-sz.h, sz.w+1, sz.h );
|
530
|
555
|
}
|
|
556
|
+
|
|
557
|
+bool cmGrDcPointIsVisible( cmGrDcH_t h, int x, int y )
|
|
558
|
+{
|
|
559
|
+ cmGrDc_t* p = _cmGrDcHandleToPtr(h);
|
|
560
|
+ return cmGrVExtIsXyInside(&p->pext,x,y);
|
|
561
|
+}
|
|
562
|
+
|
|
563
|
+bool cmGrDcRectIsVisible( cmGrDcH_t h, const cmGrPExt_t* r )
|
|
564
|
+{
|
|
565
|
+ cmGrPExt_t res;
|
|
566
|
+ cmGrDc_t* p = _cmGrDcHandleToPtr(h);
|
|
567
|
+ cmGrPExtIntersect(&res,&p->pext,r );
|
|
568
|
+ return cmGrPExtIsNotNullOrEmpty(&res);
|
|
569
|
+}
|