1
0
mirror of git://projects.qi-hardware.com/openwrt-packages.git synced 2024-11-25 16:05:20 +02:00

plplot: adapt font size scaling to smaller nanonote display

This commit is contained in:
David Kühling 2011-01-09 14:46:39 +01:00
parent 2343639830
commit a05abc9cb9
2 changed files with 30 additions and 9 deletions

View File

@ -1,7 +1,7 @@
Index: plplot-5.9.7/drivers/linuxvga.c
===================================================================
--- plplot-5.9.7.orig/drivers/linuxvga.c 2011-01-08 12:20:09.000000000 +0100
+++ plplot-5.9.7/drivers/linuxvga.c 2011-01-08 15:37:11.000000000 +0100
+++ plplot-5.9.7/drivers/linuxvga.c 2011-01-09 14:23:05.000000000 +0100
@@ -39,8 +39,8 @@
/* INDENT ON */
@ -22,16 +22,19 @@ Index: plplot-5.9.7/drivers/linuxvga.c
if ( vga_hasmode( mode ) )
vga_setmode( mode );
else
@@ -202,24 +202,40 @@
@@ -111,7 +111,7 @@
totcol = vga_getcolors();
- plP_setpxl( 2.5, 2.5 ); /* My best guess. Seems to work okay. */
+ plP_setpxl( 1.0, 1.0 );
plP_setphy( 0, vgax, 0, vgay );
}
@@ -202,24 +202,34 @@
void
plD_state_vga( PLStream *pls, PLINT op )
{
+ static const int vga_palette[16] = {
+ 0x000000, 0x000080, 0x008000, 0x008080,
+ 0x800000, 0x800080, 0x808000, 0xc0c0c0,
+ 0x808080, 0x0000ff, 0x00ff00, 0x00ffff,
+ 0xff0000, 0xff00ff, 0xffff00, 0xffffff
+ };
+ int r, g, b;
+
switch ( op )

View File

@ -0,0 +1,18 @@
Index: plplot-5.9.7/src/plpage.c
===================================================================
--- plplot-5.9.7.orig/src/plpage.c 2011-01-09 14:23:21.000000000 +0100
+++ plplot-5.9.7/src/plpage.c 2011-01-09 14:37:42.000000000 +0100
@@ -152,9 +152,12 @@
// Reduce sizes with plot area (non-proportional, so that character
// size doesn't get too small).
//
+ /* on small screens this won't work right. decrease virtual page length
+ * to match the nanonote's small screen */
scale = 0.5 *
( ( plsc->phyxma - plsc->phyxmi ) / plsc->xpmm +
- ( plsc->phyyma - plsc->phyymi ) / plsc->ypmm ) / 200.0;
+ ( plsc->phyyma - plsc->phyymi ) / plsc->ypmm ) / 160.0;
+ /* was: /200.0 */
// Take account of scaling caused by change of orientation
if ( plsc->difilt && PLDI_ORI )