updated on Thu Jan 19 16:10:29 UTC 2012
[aur-mirror.git] / habak-mw / habak-mW.patch
blob52196b0cc4dee0a4d397990da35643ee544d81ba
1 diff --git a/src/habak.c b/src/habak.c
2 index 69d1b6d..4c6b391 100644
3 --- a/src/habak.c
4 +++ b/src/habak.c
5 @@ -111,6 +111,10 @@ Active by default.\n\
6 Implies \"-mC\".\n\
7 Inactive by default.\n\
8 \n\
9 +-mW -- Habak will be proportionally stretched to fill the screen horizontally.\n\
10 +Implies \"-mC\".\n\
11 +Inactive by default.\n\
12 +\n\
13 -ms -- Habak will be non-proportionally stretched to fill the screen.\n\
14 Overrides and can be overriden by \"-mp\".\n\
15 Inactive by default.\n\
16 @@ -206,6 +210,10 @@ for (i=1;i<argc;i++) {
17 d("parse scale");
18 template_habak.scale_art=MOD_SCALE;
20 + else if (!strcmp(argv[i],"-mW")) {
21 + d("parse width scale");
22 + template_habak.scale_art=MOD_SCALE_WIDTH;
23 + }
24 else if (!strcmp(argv[i],"-ms")) {
25 d("parse uglyscale");
26 template_habak.scale_art=MOD_SCALE_NOPROP;
27 @@ -404,6 +412,12 @@ switch (current_list_item->data.type) {
28 current_list_item->data.height=current_list_item->data.orig_height*yco;
29 current_list_item->data.x = (scr->width-current_list_item->data.width)/2;
30 current_list_item->data.y = (scr->height-current_list_item->data.height)/2;
31 + } else if (current_list_item->data.scale_art==MOD_SCALE_WIDTH) {
32 + xco=((double)scr->width/(double)current_list_item->data.orig_width);
33 + yco=xco;
34 + current_list_item->data.width=current_list_item->data.orig_width*xco;
35 + current_list_item->data.height=current_list_item->data.orig_height*yco;
36 + current_list_item->data.x = (scr->width-current_list_item->data.width)/2;
37 } else {
38 /* brzydkie skalowanie
39 * W sumie to mog³em je robiæ wcze¶niej, ale dorzucam je tutaj,
40 diff --git a/src/types.h b/src/types.h
41 index 07c69af..e152b3c 100644
42 --- a/src/types.h
43 +++ b/src/types.h
44 @@ -10,6 +10,7 @@
45 #define MOD_NOCENTER 0
46 #define MOD_NOSCALE 0
47 #define MOD_SCALE 'S'
48 +#define MOD_SCALE_WIDTH 'W'
49 #define MOD_SCALE_NOPROP 's'
50 #define MOD_PAINT 'c'
51 #define MOD_POSITION 'p'