r13384 mono - in /trunk/netsurf/atari: slider.c slider.h
by netsurf@semichrome.net
Author: mono
Date: Fri Jan 6 16:15:56 2012
New Revision: 13384
URL: http://source.netsurf-browser.org?rev=13384&view=rev
Log:
Removed unused source files.
Removed:
trunk/netsurf/atari/slider.c
trunk/netsurf/atari/slider.h
Removed: trunk/netsurf/atari/slider.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/slider.c?rev=13383&...
==============================================================================
--- trunk/netsurf/atari/slider.c (original)
+++ trunk/netsurf/atari/slider.c (removed)
@@ -1,131 +1,0 @@
-/*
- * Copyright 2010 Ole Loots <ole(a)monochrom.net>
- *
- * This file is part of NetSurf, http://www.netsurf-browser.org/
- *
- * NetSurf is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * NetSurf is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "atari/slider.h"
-
-long inline slider_pages( long content_dim, long workarea_dim )
-{
- long ret;
- ret = (long)ceil( (float)content_dim / (float)workarea_dim );
- if( ret <= 0 )
- ret = 1;
- return( ret );
-}
-
-float inline slider_pages_dec( long content_dim, long workarea_dim )
-{
- float ret;
- ret = (float)content_dim / (float)workarea_dim );
- if( ret <= 0 )
- ret = 1;
- return( ret );
-}
-
-
-int slider_gem_size( long content_dim, long workarea_dim )
-{
- int ret;
- int pages = slider_pages(content_dim, workarea_dim);
- if( pages <= 0 )
- return 1;
- ret = 1000 / pages;
- if( ret <= 0 )
- ret = 1;
- return( ret );
-}
-
-
-int slider_pos_to_gem_pos( long content_dim, long workarea_dim, long slider_pos )
-{
- int ret;
- int spos = slider_max_pos( content_dim, workarea_dim );
- if( spos < 1 )
- return( 0 );
- float x = (float)1000 / spos;
- if(content_dim >= 1000)
- ret = (int)( x * slider_pos );
- else
- ret = (int)ceilf( (float)x * slider_pos );
- return( max(0, ret) );
-}
-
-
-long slider_gem_pos_to_pos( long content_dim, long workarea_dim, int slider_pos )
-{
- long ret;
- int nmax = slider_max_pos( content_dim, workarea_dim );
- float x = (float)1000 / nmax;
- if(content_dim >= 1000)
- ret = (int) ( (float) slider_pos * x);
- else
- ret = (int) ceilf( (float)slider_pos * x );
- return( max(0, ret) );
-}
-
-
-long inline slider_gem_size_to_res( long workarea_dim, int gem_size )
-{
- /* subtract [<-] and [->] buttons (16*2) from workarea: */
- int factor = 1000 / (workarea_dim - 16*2);
- return( max(1, gem_size / factor) );
-}
-
-
-long slider_gem_pos_to_res( long content_dim, long workarea_dim, int gem_pos )
-{
- /* subtract size of boxchar: */
- int room = workarea_dim - 16 * 2 - slider_gem_size_to_res(workarea_dim, slider_gem_sz );
-
- /*
- 1. Berechnen welchem Prozentsatz die GEM Position entspricht:
- 1000 = Grundwert
- gem_pos = Prozentwert
- Prozentsatz = ?
- Rechnung: Prozentwert * 100 / 1000
- Gekürzt: Prozentwert / 10
- p_calc = der Prozentsatz / 100 -> fuer vereinfachte nutzung
- */
- /* float p_gem = (float)gem_pos / 10; */
- float p_calc = (float)gem_pos / 1000;
-
- /*
- 2. Berechnen welchem Pixel der Prozentsatz entspricht
- room = Grundwert
- p_gem = Prozentsatz
- Prozentwert = ?
- Rechnung = G * p / 100
- Anmerkung: es wird p_calc verwendet, da praktischer...
- */
- int pixel = (float)((float)room * p_calc)+0.5;
-
- return( pixel );
-}
-
-
-/*
-
-Not implemented
-
-long slider_pos_to_res( long content_dim, long workarea_dim, int pos )
-{
- long max_pos = slider_max_pos( content_dim, workarea_dim );
- return( -1 );
-}
- */
-
-
Removed: trunk/netsurf/atari/slider.h
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/slider.h?rev=13383&...
==============================================================================
--- trunk/netsurf/atari/slider.h (original)
+++ trunk/netsurf/atari/slider.h (removed)
@@ -1,57 +1,0 @@
-/*
- * Copyright 2010 Ole Loots <ole(a)monochrom.net>
- *
- * This file is part of NetSurf, http://www.netsurf-browser.org/
- *
- * NetSurf is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * NetSurf is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef NS_SLIDER_H_INCLUDED
-#define NS_SLIDER_H_INCLUDED
-
-/* -------------------------------------------------------------------------- */
-/* Slider Interface: */
-/* -------------------------------------------------------------------------- */
-
-#define BR_SCROLLBAR_SZ 16
-
-/* Calculate how many pixel an specific page of the content contains */
-#define SLIDER_PIXELS_ON_PAGE( long content_dim, long workarea_dim, long page )\
- min( workarea_dim, content_dim - page * workarea_dim)
-
-/* Returns max internal slider pos, counting from zero */
-#define SLIDER_MAX_POS(content_dim, workarea_dim) max( 0, content_dim - workarea_dim)
-
-/* Calculate the number of content-"pages" for window size */
-long inline slider_pages( long content_dim, long workarea_dim );
-float inline slider_pages_dec( long content_dim, long workarea_dim )
-
-/* Convert content size into gem slider size ( 0 - 1000 ) */
-int inline slider_gem_size( long content_dim, long workarea_dim );
-
-/* convert internal slider position to gem slider position */
-int slider_pos_to_gem_pos( long content_dim, long workarea_dim, long slider_pos );
-
-/* convert gem slider pos to "internal" pos system */
-long slider_gem_pos_to_pos( long content_dim, long workarea_dim, int slider_pos );
-
-/* Calculate the gem slider mover size into pixel size */
-long slider_gem_size_to_res( long workarea_dim, int gem_size );
-
-/* Convert the gem Slider pos to an pixel value */
-long slider_gem_pos_to_res( long content_dim, long workarea_dim, int gem_pos );
-
-
-
-
-#endif
11 years, 2 months
r13383 mono - in /trunk/netsurf/atari/doc: bugs changes.txt readme.txt
by netsurf@semichrome.net
Author: mono
Date: Fri Jan 6 16:12:20 2012
New Revision: 13383
URL: http://source.netsurf-browser.org?rev=13383&view=rev
Log:
Updated docs.
Modified:
trunk/netsurf/atari/doc/bugs
trunk/netsurf/atari/doc/changes.txt
trunk/netsurf/atari/doc/readme.txt
Modified: trunk/netsurf/atari/doc/bugs
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/doc/bugs?rev=13383&...
==============================================================================
--- trunk/netsurf/atari/doc/bugs (original)
+++ trunk/netsurf/atari/doc/bugs Fri Jan 6 16:12:20 2012
@@ -1,8 +1,4 @@
KNOWN BUGS
- - On classic TOS systems (aka !FreeMiNT) the palette is reset
- when a new window is opened. This means: when opening a new window,
- the colors aren't correct!
- - Double Redraws when used with classic TOS Systems.
- - Browser window can not be moved out of the desktop area, to the right.
-
+- "View Source" only works when the configured editor is already launched.
+- Wrong redraw area when parts of the window move out of the screen area.
Modified: trunk/netsurf/atari/doc/changes.txt
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/doc/changes.txt?rev...
==============================================================================
--- trunk/netsurf/atari/doc/changes.txt (original)
+++ trunk/netsurf/atari/doc/changes.txt Fri Jan 6 16:12:20 2012
@@ -8,3 +8,7 @@
- process commandline parameter w (width) / h (height) for default window size
- improved mouse drag within treeview, browser win, toolbar.
- Fixed file drop in frames
+ - Implemented option dialog
+ - Improved GUI speed by fixing throbber code.
+ - Implemented "Save as" ( no improvements where made to core-functions ).
+ - Implemented settings dialog
Modified: trunk/netsurf/atari/doc/readme.txt
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/doc/readme.txt?rev=...
==============================================================================
--- trunk/netsurf/atari/doc/readme.txt (original)
+++ trunk/netsurf/atari/doc/readme.txt Fri Jan 6 16:12:20 2012
@@ -17,12 +17,12 @@
Table of Contents:
------------------
-0x01 - What is it?
-0x02 - System Requirements
+0x01 - What is it?
+0x02 - System Requirements
0x03 - Features
-0x04 - Missing features
+0x04 - Missing features
0x05 - Things to test
-0x06 - Additional Notes
+0x06 - Additional Notes
0x07 - Known bugs
0x08 - Technical information
@@ -30,9 +30,9 @@
What is it? A web browser!
--------------------------
- NetSurf is a multi-platform web browser which is written with
- portability and speed in mind.
- This is the native Port for the FreeMiNT OS.
+ NetSurf is a multi-platform web browser which is written with
+ portability and speed in mind.
+ This is the native Port for the FreeMiNT OS.
More info at project website: www.netsurf-browser.org
@@ -41,16 +41,16 @@
- 32 MB RAM ( 48 MB recommended for demanding websites )
- 32 MHz ( 60 Mhz recommended )
- - At least 15 Bit Graphics card.
+ - At least 15 Bit Graphics card.
- FreeMiNT 1.17.0 release kernel (Please look at FAQ to read
about TOS support) for full & correct network support.
-
+
Main Features:
--------------
- Very good HTML 4 & CSS 2.1 rendering
- - HTTPS
+ - HTTPS
- Freetype2 font rendering
@@ -58,30 +58,29 @@
-----------------
This section describes Features that NetSurf-Core offers but which are not
- handled by the GEM frontend currently.
+ handled by the GEM frontend currently.
- - Configuration dialog (use texteditor instead)
- - Grapical website history dialog
+ - Grapical website history dialog
Installation Notes:
-------------------
- Unpack the compressed archive that you downloaded,
+ Unpack the compressed archive that you downloaded,
change into the new directory and run ns.prg.
- If something isn't working - run ns.prg within an console and
+ If something isn't working - run ns.prg within an console and
enable logging:
- ./ns.prg -v
+ ./ns.prg -v
that makes it possible, that you can identify the problem.
Additional Notes
----------------
-
- If you would like to see the above mentioned features or
- can't run NetSurf because you only have a 16 or 256 Color system
+
+ If you would like to see the above mentioned features or
+ can't run NetSurf because you only have a 16 or 256 Color system
get in contact.
Please also check the FAQ document.
@@ -95,18 +94,15 @@
so far. This release lacks some features and some of the code written
was just coded with an "I have to get this done quickly" attitude.
This is especially true for the drawin routines... It doesn't offer
- offscreen bitmaps, which was one of my goals for a release. But
+ offscreen bitmaps, which was one of my goals for a release. But
I dropped that in favor of an not-so-delayed release.
Known Bugs
----------
-
- - Redraw artefacts/false clipping when moving other applications above
- NetSurf.
- - Double Redraws when used with classic TOS systems.
- - Window can not be moved out of the desktop area to the right
-
+
+ - "View Source" only works when the configured editor is already launched.
+ - Wrong redraw area when parts of the window move out of the screen area.
Technical info & outlook
------------------------
@@ -118,10 +114,10 @@
- AtFact for providing help with resource files & images
- The MiNT Mailing list, they all helped me a lot!
- The NetSurf Mailing list guys, especially the Amiga guys.
- - The NetSurf developers that did a great job!
- - Everyone that tested this Browser!
- - Everyone that provides feedback!
- - The forum.atari-home.de members for giving me much help
+ - The NetSurf developers that did a great job!
+ - Everyone that tested this Browser!
+ - Everyone that provides feedback!
+ - The forum.atari-home.de members for giving me much help
during setup of my atari!
11 years, 2 months
r13382 mono - in /trunk/netsurf/atari/plot: plotter.h plotter_vdi.c
by netsurf@semichrome.net
Author: mono
Date: Fri Jan 6 16:10:10 2012
New Revision: 13382
URL: http://source.netsurf-browser.org?rev=13382&view=rev
Log:
Added missing prototypes.
Modified:
trunk/netsurf/atari/plot/plotter.h
trunk/netsurf/atari/plot/plotter_vdi.c
Modified: trunk/netsurf/atari/plot/plotter.h
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/plot/plotter.h?rev=...
==============================================================================
--- trunk/netsurf/atari/plot/plotter.h (original)
+++ trunk/netsurf/atari/plot/plotter.h Fri Jan 6 16:10:10 2012
@@ -303,8 +303,10 @@
void dump_plot_drivers(void);
void dump_vdi_info(short);
-
-/* convert an rgb color to vdi1000 color */
+/* convert an vdi color to bgra */
+void vdi1000_to_rgb( unsigned short * in, unsigned char * out );
+
+/* convert an bgra color to vdi1000 color */
void rgb_to_vdi1000( unsigned char * in, unsigned short * out );
/* convert an rgb color to an index into the web palette */
Modified: trunk/netsurf/atari/plot/plotter_vdi.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/plot/plotter_vdi.c?...
==============================================================================
--- trunk/netsurf/atari/plot/plotter_vdi.c (original)
+++ trunk/netsurf/atari/plot/plotter_vdi.c Fri Jan 6 16:10:10 2012
@@ -70,6 +70,9 @@
unsigned long bg, unsigned long flags );
static int plot_mfdb( GEM_PLOTTER self, GRECT * where, MFDB * mfdb, unsigned char fgcolor, uint32_t flags);
static int text(GEM_PLOTTER self, int x, int y, const char *text,size_t length, const plot_font_style_t *fstyle);
+
+static inline void set_stdpx( MFDB * dst, int wdplanesz, int x, int y, unsigned char val );
+static inline unsigned char get_stdpx(MFDB * dst, int wdplanesz, int x, int y );
#ifdef WITH_8BPP_SUPPORT
@@ -212,7 +215,7 @@
}
}
- vdi1000_to_rgb( &pal[i], &rgb_lookup[i][0] );
+ vdi1000_to_rgb( &pal[i][0], &rgb_lookup[i][0] );
}
} else {
@@ -953,7 +956,6 @@
}
}
-
inline void set_stdpx( MFDB * dst, int wdplanesz, int x, int y, unsigned char val )
{
short * buf;
@@ -1128,7 +1130,7 @@
// apply transparency.
if( transp ){
unsigned long bgcol = 0;
- unsigned char prev_col = 0x12345678;
+ unsigned char prev_col = 0;
for( y=0; y<clip->g_h; y++ ){
@@ -1145,7 +1147,7 @@
if( (pixel&0xFF) < 0xF0 ){
col = get_stdpx( &stdform, wdplanesize,x,y );
- if( col != prev_col )
+ if( (col != prev_col) || (y == 0) )
bgcol = (((rgb_lookup[col][2] << 16) | (rgb_lookup[col][1] << 8) | (rgb_lookup[col][0]))<<8);
if( prev_col != col || prev_pixel != pixel ){
prev_col = col;
11 years, 2 months
r13381 mono - /trunk/netsurf/atari/plot.c
by netsurf@semichrome.net
Author: mono
Date: Fri Jan 6 16:06:31 2012
New Revision: 13381
URL: http://source.netsurf-browser.org?rev=13381&view=rev
Log:
Added flag for monochrom font rendering.
Modified:
trunk/netsurf/atari/plot.c
Modified: trunk/netsurf/atari/plot.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/plot.c?rev=13381&r1...
==============================================================================
--- trunk/netsurf/atari/plot.c (original)
+++ trunk/netsurf/atari/plot.c Fri Jan 6 16:06:31 2012
@@ -54,12 +54,15 @@
GRECT loc_pos={0,0,360,400};
int err=0;
struct s_driver_table_entry * drvinfo;
- int flags = 0;
+ int flags = 0;
+ unsigned long font_flags = 0;
if( option_atari_dither == 1)
flags |= PLOT_FLAG_DITHER;
if( option_atari_transparency == 1 )
- flags |= PLOT_FLAG_TRANS;
+ flags |= PLOT_FLAG_TRANS;
+ if( option_atari_font_monochrom == 1 )
+ font_flags |= FONTPLOT_FLAG_MONOGLYPH;
vdih = app.graf.handle;
if( verbose_log ) {
@@ -70,7 +73,7 @@
drvinfo = get_screen_driver_entry( drvrname );
LOG(("using plotters: %s, %s", drvrname, fdrvrname));
- fplotter = new_font_plotter(vdih, fdrvrname, 0, &err );
+ fplotter = new_font_plotter(vdih, fdrvrname, font_flags, &err );
if(err){
char * desc = plotter_err_str(err);
die(("Unable to load font plotter %s -> %s", fdrvrname, desc ));
@@ -153,11 +156,11 @@
bool repeat_x = (flags & BITMAPF_REPEAT_X);
bool repeat_y = (flags & BITMAPF_REPEAT_Y);
int bmpw,bmph;
- struct rect clip;
+ struct rect clip;
bmpw = bitmap_get_width(bitmap);
- bmph = bitmap_get_height(bitmap);
-
+ bmph = bitmap_get_height(bitmap);
+
if ( repeat_x || repeat_y ) {
plotter_get_clip( plotter, &clip );
if( repeat_x && width == 1 && repeat_y && height == 1 ){
11 years, 2 months
r13379 mono - /trunk/netsurf/atari/schedule.c
by netsurf@semichrome.net
Author: mono
Date: Fri Jan 6 16:04:23 2012
New Revision: 13379
URL: http://source.netsurf-browser.org?rev=13379&view=rev
Log:
Added schedule stats.
Modified:
trunk/netsurf/atari/schedule.c
Modified: trunk/netsurf/atari/schedule.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/schedule.c?rev=1337...
==============================================================================
--- trunk/netsurf/atari/schedule.c (original)
+++ trunk/netsurf/atari/schedule.c Fri Jan 6 16:04:23 2012
@@ -43,7 +43,8 @@
void *p;
};
-
+static int max_scheduled;
+static int cur_scheduled;
/**
* Schedule a callback.
@@ -68,13 +69,18 @@
nscb = calloc(1, sizeof(struct nscallback));
nscb->timeout = CS_NOW() + cs_ival;
+#ifdef DEBUG_SCHEDULER
LOG(("adding callback %p for %p(%p) at %d cs", nscb, callback, p, nscb->timeout ));
+#endif
nscb->callback = callback;
nscb->p = p;
/* add to list front */
nscb->next = schedule_list;
schedule_list = nscb;
+ cur_scheduled++;
+ if( cur_scheduled > max_scheduled )
+ max_scheduled = cur_scheduled;
}
@@ -122,6 +128,7 @@
prev_nscb->next = cur_nscb;
}
free (unlnk_nscb);
+ cur_scheduled--;
} else {
/* move to next element */
prev_nscb = cur_nscb;
@@ -169,6 +176,7 @@
/* call callback */
unlnk_nscb->callback(unlnk_nscb->p);
free(unlnk_nscb);
+ cur_scheduled--;
/* need to deal with callback modifying the list. */
if (schedule_list == NULL) {
@@ -217,6 +225,7 @@
LOG(("Schedule %p at %ld", cur_nscb, cur_nscb->timeout ));
cur_nscb = cur_nscb->next;
}
+ LOG(("Maxmium callbacks scheduled: %d", max_scheduled ));
}
11 years, 2 months
r13378 mono - in /trunk/netsurf/atari: bitmap.c bitmap.h
by netsurf@semichrome.net
Author: mono
Date: Fri Jan 6 15:57:42 2012
New Revision: 13378
URL: http://source.netsurf-browser.org?rev=13378&view=rev
Log:
Only set opaque on initial alloc, add flag for clearing buffer on realloc.
Modified:
trunk/netsurf/atari/bitmap.c
trunk/netsurf/atari/bitmap.h
Modified: trunk/netsurf/atari/bitmap.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/bitmap.c?rev=13378&...
==============================================================================
--- trunk/netsurf/atari/bitmap.c (original)
+++ trunk/netsurf/atari/bitmap.c Fri Jan 6 15:57:42 2012
@@ -105,6 +105,7 @@
assert( 1 == 0 );
/* add some buffer for bad code */
bitmap->pixdata = malloc( newsize + 128 );
+ bitmap->opaque = false;
} else {
int oldsize = bitmap->rowstride * bitmap->height;
bool doalloc = ( state == BITMAP_GROW) ? (newsize > oldsize) : (newsize != oldsize);
@@ -116,10 +117,12 @@
return( NULL );
}
}
+ if( state & BITMAP_CLEAR ){
+ memset( bitmap->pixdata, 0x00, newsize + 128 );
+ }
bitmap->width = w;
bitmap->height = h;
- bitmap->opaque = false;
bitmap->bpp = bpp;
bitmap->resized = NULL;
bitmap->rowstride = rowstride;
Modified: trunk/netsurf/atari/bitmap.h
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/bitmap.h?rev=13378&...
==============================================================================
--- trunk/netsurf/atari/bitmap.h (original)
+++ trunk/netsurf/atari/bitmap.h Fri Jan 6 15:57:42 2012
@@ -22,6 +22,7 @@
#define BITMAP_SHRINK 0
#define BITMAP_GROW 0x1024
#define BITMAP_MONOGLYPH 0x2048
+#define BITMAP_CLEAR 0x4096
struct bitmap {
int width;
11 years, 2 months
r13377 chris_y - /trunk/netsurf/amiga/options.h
by netsurf@semichrome.net
Author: chris_y
Date: Fri Jan 6 12:55:30 2012
New Revision: 13377
URL: http://source.netsurf-browser.org?rev=13377&view=rev
Log:
Default X and Y aspect ratio to 0. This will make NetSurf assume that the screen has
square pixels, which is true in 99% of cases on OS4.
Modified:
trunk/netsurf/amiga/options.h
Modified: trunk/netsurf/amiga/options.h
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/options.h?rev=13377...
==============================================================================
--- trunk/netsurf/amiga/options.h (original)
+++ trunk/netsurf/amiga/options.h Fri Jan 6 12:55:30 2012
@@ -114,8 +114,8 @@
int option_cairo_renderer = 1; \
bool option_direct_render = false; \
int option_amiga_ydpi = 72; \
-int option_monitor_aspect_x = 4; \
-int option_monitor_aspect_y = 3; \
+int option_monitor_aspect_x = 0; \
+int option_monitor_aspect_y = 0; \
bool option_accept_lang_locale = true; \
int option_menu_refresh = 0; \
11 years, 2 months
r13376 tlsa - /trunk/netsurf/desktop/frames.c
by netsurf@semichrome.net
Author: tlsa
Date: Fri Jan 6 08:44:01 2012
New Revision: 13376
URL: http://source.netsurf-browser.org?rev=13376&view=rev
Log:
Simplify frameset distribution calcs.
Modified:
trunk/netsurf/desktop/frames.c
Modified: trunk/netsurf/desktop/frames.c
URL: http://source.netsurf-browser.org/trunk/netsurf/desktop/frames.c?rev=1337...
==============================================================================
--- trunk/netsurf/desktop/frames.c (original)
+++ trunk/netsurf/desktop/frames.c Fri Jan 6 08:44:01 2012
@@ -462,8 +462,9 @@
avail_width -= widths[col][row];
}
- /* distribute remainder to relative values in preference */
+ /* Redistribute to fit window */
if ((relative > 0) && (avail_width > 0)) {
+ /* Expand the relative sections to fill remainder */
for (col = 0; col < bw->cols; col++) {
index = (row * bw->cols) + col;
window = &bw->children[index];
@@ -484,19 +485,18 @@
applied = 0;
for (col = 0; col < bw->cols; col++) {
if (col == bw->cols - 1) {
- size = extent - applied;
- widths[col][row] += (size > 0) ?
- size : 0;
+ /* Last cell, use up remainder */
+ widths[col][row] += extent - applied;
+ widths[col][row] =
+ widths[col][row] < 0 ?
+ 0 : widths[col][row];
} else {
- /* Intermediate step: get absolute
- * extent value */
- size = extent < 0 ? -extent : extent;
-
/* Find size of cell adjustment */
size = (widths[col][row] * extent) /
- (bw_width - size);
+ (bw_width - extent);
+ /* Modify cell */
+ widths[col][row] += size;
applied += size;
- widths[col][row] += size;
}
}
}
@@ -545,8 +545,9 @@
if (avail_height == 0)
continue;
- /* try to distribute remainder to relative values in preference */
+ /* Redistribute to fit window */
if ((relative > 0) && (avail_height > 0)) {
+ /* Expand the relative sections to fill remainder */
for (row = 0; row < bw->rows; row++) {
index = (row * bw->cols) + col;
window = &bw->children[index];
@@ -567,19 +568,18 @@
applied = 0;
for (row = 0; row < bw->rows; row++) {
if (row == bw->rows - 1) {
- size = extent - applied;
- heights[col][row] += (size > 0) ?
- size : 0;
+ /* Last cell, use up remainder */
+ heights[col][row] += extent - applied;
+ heights[col][row] =
+ heights[col][row] < 0 ?
+ 0 : heights[col][row];
} else {
- /* Intermediate step: get absolute
- * extent value */
- size = extent < 0 ? -extent : extent;
-
/* Find size of cell adjustment */
size = (heights[col][row] * extent) /
- (bw_height - size);
+ (bw_height - extent);
+ /* Modify cell */
+ heights[col][row] += size;
applied += size;
- heights[col][row] += size;
}
}
}
11 years, 2 months