wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src/editor editor_palettes.cpp editor_l...


From: Bram Ridder
Subject: [Wesnoth-cvs-commits] wesnoth/src/editor editor_palettes.cpp editor_l...
Date: Fri, 15 Jul 2005 07:44:55 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Bram Ridder <address@hidden>    05/07/15 11:44:55

Modified files:
        src/editor     : editor_palettes.cpp editor_layout.cpp 
                         editor_layout.hpp 

Log message:
        Created some padding between the brushes

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/editor/editor_palettes.cpp.diff?tr1=1.30&tr2=1.31&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/editor/editor_layout.cpp.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/editor/editor_layout.hpp.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: wesnoth/src/editor/editor_layout.cpp
diff -u wesnoth/src/editor/editor_layout.cpp:1.8 
wesnoth/src/editor/editor_layout.cpp:1.9
--- wesnoth/src/editor/editor_layout.cpp:1.8    Wed Jul 13 00:27:57 2005
+++ wesnoth/src/editor/editor_layout.cpp        Fri Jul 15 11:44:54 2005
@@ -28,6 +28,7 @@
        terrain_width = default_palette_width;
        brush_x = 0;
        brush_y = 0;
+       brush_padding = 5;
        palette_x = 0;
        palette_y = 0;
        palette_w = 10;
@@ -35,7 +36,7 @@
 }
 
 void adjust_sizes(const display &disp, size_specs &sizes) {
-       sizes.brush_x = disp.mapx() + 28;
+       sizes.brush_x = disp.mapx() + 23;
        sizes.brush_y = 190;
        sizes.palette_x = disp.mapx() + 13;
        sizes.palette_y = sizes.brush_y + 160 + 10;
Index: wesnoth/src/editor/editor_layout.hpp
diff -u wesnoth/src/editor/editor_layout.hpp:1.6 
wesnoth/src/editor/editor_layout.hpp:1.7
--- wesnoth/src/editor/editor_layout.hpp:1.6    Tue Jul  5 10:14:50 2005
+++ wesnoth/src/editor/editor_layout.hpp        Fri Jul 15 11:44:54 2005
@@ -33,6 +33,7 @@
        size_t palette_w;
        size_t brush_x;
        size_t brush_y;
+       size_t brush_padding;
 };
 
 /// Adjust the internal size specifications to fit the display.
Index: wesnoth/src/editor/editor_palettes.cpp
diff -u wesnoth/src/editor/editor_palettes.cpp:1.30 
wesnoth/src/editor/editor_palettes.cpp:1.31
--- wesnoth/src/editor/editor_palettes.cpp:1.30 Tue Jul  5 10:14:50 2005
+++ wesnoth/src/editor/editor_palettes.cpp      Fri Jul 15 11:44:54 2005
@@ -329,9 +329,9 @@
        adjust_size();
 }
 
-void brush_bar::adjust_size() {
+void brush_bar::adjust_size() {// TODO
        set_location(size_specs_.brush_x, size_specs_.brush_y);
-       set_measurements(size_ * total_brush_, size_);
+       set_measurements(size_ * total_brush_ + (total_brush_ - 1) * 
size_specs_.brush_padding, size_);
        set_dirty();
 }
 
@@ -417,7 +417,7 @@
                        SDL_MapRGB(screen->format,0xFF,0x00,0x00) :
                        SDL_MapRGB(screen->format,0x00,0x00,0x00);
                draw_rectangle(dstrect.x, dstrect.y, image->w, image->h, color, 
screen);
-               x += image->w;
+               x += image->w + size_specs_.brush_padding;
        }
        update_rect(loc);
        set_dirty(false);
@@ -427,13 +427,13 @@
        const int bar_x = size_specs_.brush_x;
        const int bar_y = size_specs_.brush_y;
 
-       if ((x < bar_x || (unsigned)x > bar_x + size_ * total_brush_)
+       if ((x < bar_x || (unsigned)x > bar_x + size_ * total_brush_ + 
total_brush_ * size_specs_.brush_padding)
            || (y < bar_y || (unsigned)y > bar_y + size_)) {
                return -1;
        }
 
        for(int i = 0; i < total_brush_; i++) {
-               const int px = bar_x + size_ * i;
+               const int px = bar_x + size_ * i + i * 
size_specs_.brush_padding;
 
                if(x >= px && (unsigned)x <= px + size_ && y >= bar_y && 
(unsigned)y <= bar_y + size_) {
                        return i;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]