draw hint borders wider on high-res devices so they're actually visible

This commit is contained in:
ehouse 2007-12-19 05:29:53 +00:00
parent ef8a5d0b11
commit eafec70d01

View file

@ -398,34 +398,47 @@ palm_clr_draw_score_drawPlayer( DrawCtx* p_dctx, const XP_Rect* rInner,
WinPopDrawState(); WinPopDrawState();
} /* palm_clr_draw_score_drawPlayer */ } /* palm_clr_draw_score_drawPlayer */
#endif /* #ifdef COLOR_SUPPORT */
#endif
static void static void
palmDrawHintBorders( const XP_Rect* rect, HintAtts hintAtts ) palmDrawHintBorders( PalmDrawCtx* dctx, const XP_Rect* rect,
HintAtts hintAtts )
{ {
if ( hintAtts != HINT_BORDER_NONE && hintAtts != HINT_BORDER_CENTER ) { if ( 0 != (HINT_BORDER_EDGE & hintAtts) ) {
XP_Rect frame = *rect; XP_Rect frame = *rect;
insetRect( &frame, 1 ); XP_U16 width = dctx->doHiRes ? 4 : 2;
XP_Bool showGrid = dctx->globals->gState.showGrid;
if ( showGrid ) {
++width;
}
if ( (hintAtts & HINT_BORDER_LEFT) != 0 ) { if ( (hintAtts & HINT_BORDER_LEFT) != 0 ) {
WinDrawLine( frame.left, frame.top, XP_Rect r = frame;
frame.left, frame.top + frame.height ); r.width = width;
WinDrawRectangle( (RectangleType*)&r, 0 );
} }
if ( (hintAtts & HINT_BORDER_TOP) != 0 ) { if ( (hintAtts & HINT_BORDER_TOP) != 0 ) {
WinDrawLine( frame.left, frame.top, XP_Rect r = frame;
frame.left + frame.width, frame.top ); r.height = width;
WinDrawRectangle( (RectangleType*)&r, 0 );
} }
if ( (hintAtts & HINT_BORDER_RIGHT) != 0 ) { if ( (hintAtts & HINT_BORDER_RIGHT) != 0 ) {
WinDrawLine( frame.left + frame.width, frame.top, XP_Rect r = frame;
frame.left + frame.width, r.left += r.width - width;
frame.top + frame.height ); if ( showGrid ) {
++r.left;
}
r.width = width;
WinDrawRectangle( (RectangleType*)&r, 0 );
} }
if ( (hintAtts & HINT_BORDER_BOTTOM) != 0 ) { if ( (hintAtts & HINT_BORDER_BOTTOM) != 0 ) {
WinDrawLine( frame.left, frame.top + frame.height, XP_Rect r = frame;
frame.left + frame.width, r.top += r.height - width;
frame.top + frame.height ); if ( showGrid ) {
++r.top;
}
r.height = width;
WinDrawRectangle( (RectangleType*)&r, 0 );
} }
} }
} /* palmDrawHintBorders */ } /* palmDrawHintBorders */
@ -570,7 +583,7 @@ palm_common_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect,
WinEraseRectangleFrame( roundFrame, (RectangleType*)&localR ); WinEraseRectangleFrame( roundFrame, (RectangleType*)&localR );
} }
palmDrawHintBorders( rect, hintAtts ); palmDrawHintBorders( dctx, rect, hintAtts );
WinSetClip( &saveClip ); WinSetClip( &saveClip );
return complete; return complete;
@ -807,7 +820,7 @@ palm_draw_drawBoardArrow( DrawCtx* p_dctx, const XP_Rect* rectP,
WinSetClip( (RectangleType*)rectP ); WinSetClip( (RectangleType*)rectP );
bitmapInRect( dctx, resID, rectP ); bitmapInRect( dctx, resID, rectP );
palmDrawHintBorders( rectP, hintAtts ); palmDrawHintBorders( dctx, rectP, hintAtts );
WinSetClip( &oldClip ); WinSetClip( &oldClip );
} /* palm_draw_drawBoardArrow */ } /* palm_draw_drawBoardArrow */