static inline int
make_box_index (int left, int right, int top, int bottom)
{
- return ((right * RENDER_N_LINES + bottom) * RENDER_N_LINES + left) * RENDER_N_LINES + top;
+ int start_side = left;
+ int end_side = right;
+ if (render_direction_rtl ())
+ {
+ start_side = right;
+ end_side = left;
+ }
+
+ return ((end_side * RENDER_N_LINES + bottom) * RENDER_N_LINES + start_side) * RENDER_N_LINES + top;
}
/* How to emphasize text. */
used = render_pager_draw_next (p, a->length - a->y);
if (used == 0)
{
- assert (a->y > 0);
+ assert (a->y >= 0);
ascii_close_page (a);
if (!ascii_open_page (a))
break;
file_name = xr_draw_png_chart (chart_item, a->chart_file_name,
a->chart_cnt++,
- &a->fg,
+ &a->fg,
&a->bg);
if (file_name != NULL)
{
if (a->file == NULL)
{
- a->file = fn_open (a->handle, a->append ? "a" : "w");
+ a->file = fn_fopen (a->handle, a->append ? "a" : "w");
if (a->file != NULL)
{
if ( isatty (fileno (a->file)))