Commit 9020d5f8 authored by Robert Sprowson's avatar Robert Sprowson Committed by ROOL
Browse files

Fully fill 'None' swatch in 180dpi modes

The Crosshatch sprite wasn't quite tall enough for the swatch when plotted in an EY0 mode, and didn't account for the icon being inset from the window border. For width, we now tile the sprite as needed (rather than enlarge the one in Resources).

Version 0.59. Tagged as 'Picker-0_59'
parent f972d9be
No preview for this file type
/* (0.58)
/* (0.59)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.58
#define Module_MajorVersion_CMHG 0.59
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 10 Apr 2021
#define Module_Date_CMHG 03 Nov 2021
#define Module_MajorVersion "0.58"
#define Module_Version 58
#define Module_MajorVersion "0.59"
#define Module_Version 59
#define Module_MinorVersion ""
#define Module_Date "10 Apr 2021"
#define Module_Date "03 Nov 2021"
#define Module_ApplicationDate "10-Apr-21"
#define Module_ApplicationDate "03-Nov-21"
#define Module_ComponentName "Picker"
#define Module_FullVersion "0.58"
#define Module_HelpVersion "0.58 (10 Apr 2021)"
#define Module_LibraryVersionInfo "0:58"
#define Module_FullVersion "0.59"
#define Module_HelpVersion "0.59 (03 Nov 2021)"
#define Module_LibraryVersionInfo "0:59"
......@@ -47,6 +47,7 @@
#include "icon.h"
#include "main.h"
#include "model.h"
#include "tables.h"
#include "veneer.h"
dialogue_task_list dialogue_active_tasks, *dialogue_last_task;
......@@ -59,7 +60,10 @@ static os_coord Size;
static os_coord Offset;
static os_coord Patch;
static osspriteop_header *Crosshatch;
static int Crosshatch_width;
static wimp_i Icons [] =
{dialogue_PICKER_RGB, dialogue_PICKER_CMYK, dialogue_PICKER_HSV};
......@@ -133,6 +137,7 @@ static os_error *Update (dialogue_list l)
relocate_frame frame;
osbool none, more;
wimp_draw update;
int patch_width, tile_x;
osspriteop_TRANS_TAB (2) trans_tab;
tracef ("Update\n");
......@@ -150,6 +155,7 @@ static os_error *Update (dialogue_list l)
update.w = l->main_w;
update.box = Picker->window.icons [dialogue_PICKER_PATCH].extent;
patch_width = (update.box.x1 - update.box.x0) >> tables_xeig; /* Pixels */
if ((error = xwimp_update_window (&update, &more)) != NULL)
goto finish;
......@@ -171,13 +177,16 @@ static os_error *Update (dialogue_list l)
goto finish;
}
else
/*Plot a crosshatched sprite to represent "no colour selected.*/
if ((error = xosspriteop_put_sprite_scaled
(osspriteop_PTR, (osspriteop_area *) 0x100,
(osspriteop_id) Crosshatch,
update.box.x0, update.box.y0, os_ACTION_USE_MASK,
NULL, (osspriteop_trans_tab *) &trans_tab)) != NULL)
goto finish;
{ /*Plot a crosshatched sprite to represent "no colour" selected.*/
for (tile_x = 0; tile_x < patch_width; tile_x += Crosshatch_width)
{ if ((error = xosspriteop_put_sprite_scaled
(osspriteop_PTR, (osspriteop_area *) 0x100,
(osspriteop_id) Crosshatch,
update.box.x0 + Patch.x + tile_x, update.box.y0 + Patch.y, os_ACTION_USE_MASK,
NULL, (osspriteop_trans_tab *) &trans_tab)) != NULL)
goto finish;
}
}
if ((error = xwimp_get_rectangle (&update, &more)) != NULL)
goto finish;
......@@ -1350,10 +1359,21 @@ os_error *dialogue_setup (void)
Picker->window.yscroll;
tracef ("offset is (%d, %d)\n" _ Offset.x _ Offset.y);
/*Get the pointer to the crosshatch sprite.*/
/*Find the offsets to the patch icon relative to BLHC.*/
Patch.x = Picker->window.icons [dialogue_PICKER_PATCH].extent.x0 -
Picker->window.extent.x0;
Patch.y = Picker->window.icons [dialogue_PICKER_PATCH].extent.y0 -
Picker->window.extent.y0;
/*Get the pointer and width of the crosshatch sprite.*/
if ((error = lookup (main_sprites, "crosshatch", (void **) &Crosshatch))
!= NULL)
goto finish;
if ((error = xosspriteop_read_sprite_info (osspriteop_PTR, (osspriteop_area *) 0x100,
(osspriteop_id) Crosshatch,
&Crosshatch_width, NULL, NULL, NULL))
!= NULL)
goto finish;
finish:
return error;
......
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