mirror of https://github.com/odrling/Aegisub
More preparations for ASS2
Originally committed to SVN as r740.
This commit is contained in:
parent
b96c7932b9
commit
a477f58582
|
@ -184,9 +184,10 @@ AssStyle::AssStyle() {
|
||||||
outline_w = 2.0;
|
outline_w = 2.0;
|
||||||
shadow_w = 2.0;
|
shadow_w = 2.0;
|
||||||
alignment = 2;
|
alignment = 2;
|
||||||
MarginL = 10;
|
Margin[0] = 10;
|
||||||
MarginR = 10;
|
Margin[1] = 10;
|
||||||
MarginV = 10;
|
Margin[2] = 10;
|
||||||
|
Margin[3] = 10;
|
||||||
encoding = 0;
|
encoding = 0;
|
||||||
|
|
||||||
UpdateData();
|
UpdateData();
|
||||||
|
@ -435,9 +436,9 @@ void AssStyle::UpdateData() {
|
||||||
final += FloatToString(shadow_w) + _T(",");
|
final += FloatToString(shadow_w) + _T(",");
|
||||||
|
|
||||||
final += IntegerToString(alignment) + _T(",");
|
final += IntegerToString(alignment) + _T(",");
|
||||||
final += IntegerToString(MarginL) + _T(",");
|
final += IntegerToString(Margin[0]) + _T(",");
|
||||||
final += IntegerToString(MarginR) + _T(",");
|
final += IntegerToString(Margin[1]) + _T(",");
|
||||||
final += IntegerToString(MarginV) + _T(",");
|
final += IntegerToString(Margin[2]) + _T(",");
|
||||||
final += IntegerToString(encoding);
|
final += IntegerToString(encoding);
|
||||||
SetEntryData(final);
|
SetEntryData(final);
|
||||||
}
|
}
|
||||||
|
@ -454,13 +455,8 @@ void AssStyle::SetMarginString(const wxString str,int which) {
|
||||||
work.ToLong(&value);
|
work.ToLong(&value);
|
||||||
if (value < 0) value = 0;
|
if (value < 0) value = 0;
|
||||||
if (value > 9999) value = 9999;
|
if (value > 9999) value = 9999;
|
||||||
switch (which) {
|
if (which < 0 || which >= 4) throw _T("Invalid margin");
|
||||||
case 0: MarginL = value; break;
|
Margin[which] = value;
|
||||||
case 1: MarginR = value; break;
|
|
||||||
case 2: MarginV = value; break;
|
|
||||||
case 3: MarginV = value; break;
|
|
||||||
default: throw _T("Invalid margin");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -468,13 +464,8 @@ void AssStyle::SetMarginString(const wxString str,int which) {
|
||||||
// Gets string for margin
|
// Gets string for margin
|
||||||
wxString AssStyle::GetMarginString(int which) {
|
wxString AssStyle::GetMarginString(int which) {
|
||||||
int value;
|
int value;
|
||||||
switch (which) {
|
if (which < 0 || which >= 4) throw _T("Invalid margin");
|
||||||
case 0: value = MarginL; break;
|
value = Margin[which];
|
||||||
case 1: value = MarginR; break;
|
|
||||||
case 2: value = MarginV; break;
|
|
||||||
case 3: value = MarginV; break;
|
|
||||||
default: throw _T("Invalid margin");
|
|
||||||
}
|
|
||||||
wxString result = wxString::Format(_T("%04i"),value);
|
wxString result = wxString::Format(_T("%04i"),value);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -519,9 +510,9 @@ wxString AssStyle::GetSSAText() {
|
||||||
}
|
}
|
||||||
output += IntegerToString(align) + _T(",");
|
output += IntegerToString(align) + _T(",");
|
||||||
|
|
||||||
output += IntegerToString(MarginL) + _T(",");
|
output += IntegerToString(Margin[0]) + _T(",");
|
||||||
output += IntegerToString(MarginR) + _T(",");
|
output += IntegerToString(Margin[1]) + _T(",");
|
||||||
output += IntegerToString(MarginV) + _T(",");
|
output += IntegerToString(Margin[2]) + _T(",");
|
||||||
output += _T("0,");
|
output += _T("0,");
|
||||||
output += IntegerToString(encoding);
|
output += IntegerToString(encoding);
|
||||||
|
|
||||||
|
@ -547,9 +538,7 @@ AssEntry *AssStyle::Clone() {
|
||||||
final->font = font;
|
final->font = font;
|
||||||
final->fontsize = fontsize;
|
final->fontsize = fontsize;
|
||||||
final->italic = italic;
|
final->italic = italic;
|
||||||
final->MarginL = MarginL;
|
for (int i=0;i<4;i++) final->Margin[i] = Margin[i];
|
||||||
final->MarginR = MarginR;
|
|
||||||
final->MarginV = MarginV;
|
|
||||||
final->name = name;
|
final->name = name;
|
||||||
final->outline = outline;
|
final->outline = outline;
|
||||||
final->outline_w = outline_w;
|
final->outline_w = outline_w;
|
||||||
|
|
|
@ -89,9 +89,7 @@ public:
|
||||||
double outline_w;
|
double outline_w;
|
||||||
double shadow_w;
|
double shadow_w;
|
||||||
int alignment;
|
int alignment;
|
||||||
int MarginL;
|
int Margin[4];
|
||||||
int MarginR;
|
|
||||||
int MarginV;
|
|
||||||
int encoding;
|
int encoding;
|
||||||
|
|
||||||
ASS_EntryType GetType() { return ENTRY_STYLE; }
|
ASS_EntryType GetType() { return ENTRY_STYLE; }
|
||||||
|
|
|
@ -191,13 +191,13 @@ namespace Automation4 {
|
||||||
lua_pushnumber(L, sty->alignment);
|
lua_pushnumber(L, sty->alignment);
|
||||||
lua_setfield(L, -2, "align");
|
lua_setfield(L, -2, "align");
|
||||||
|
|
||||||
lua_pushnumber(L, sty->MarginL);
|
lua_pushnumber(L, sty->Margin[0]);
|
||||||
lua_setfield(L, -2, "margin_l");
|
lua_setfield(L, -2, "margin_l");
|
||||||
lua_pushnumber(L, sty->MarginR);
|
lua_pushnumber(L, sty->Margin[1]);
|
||||||
lua_setfield(L, -2, "margin_r");
|
lua_setfield(L, -2, "margin_r");
|
||||||
lua_pushnumber(L, sty->MarginV); // duplicating MarginV to margin_t and margin_b here
|
lua_pushnumber(L, sty->Margin[2]);
|
||||||
lua_setfield(L, -2, "margin_t");
|
lua_setfield(L, -2, "margin_t");
|
||||||
lua_pushnumber(L, sty->MarginV);
|
lua_pushnumber(L, sty->Margin[3]);
|
||||||
lua_setfield(L, -2, "margin_b");
|
lua_setfield(L, -2, "margin_b");
|
||||||
|
|
||||||
lua_pushnumber(L, sty->encoding);
|
lua_pushnumber(L, sty->encoding);
|
||||||
|
@ -353,9 +353,10 @@ namespace Automation4 {
|
||||||
sty->outline_w = outline;
|
sty->outline_w = outline;
|
||||||
sty->shadow_w = shadow;
|
sty->shadow_w = shadow;
|
||||||
sty->alignment = align;
|
sty->alignment = align;
|
||||||
sty->MarginL = margin_l;
|
sty->Margin[0] = margin_l;
|
||||||
sty->MarginR = margin_r;
|
sty->Margin[1] = margin_r;
|
||||||
sty->MarginV = margin_t;
|
sty->Margin[2] = margin_t;
|
||||||
|
sty->Margin[3] = margin_b;
|
||||||
sty->encoding = encoding;
|
sty->encoding = encoding;
|
||||||
sty->UpdateData();
|
sty->UpdateData();
|
||||||
|
|
||||||
|
|
|
@ -224,9 +224,8 @@ void DialogResample::OnResample (wxCommandEvent &event) {
|
||||||
//curStyle->shadow_w *= r;
|
//curStyle->shadow_w *= r;
|
||||||
curStyle->spacing *= rx;
|
curStyle->spacing *= rx;
|
||||||
curStyle->scalex *= ar;
|
curStyle->scalex *= ar;
|
||||||
curStyle->MarginL = int(curStyle->MarginL * rx + 0.5);
|
for (int i=0;i<2;i++) curStyle->Margin[i] = int(curStyle->Margin[i] * rx + 0.5);
|
||||||
curStyle->MarginR = int(curStyle->MarginR * rx + 0.5);
|
for (int i=2;i<4;i++) curStyle->Margin[i] = int(curStyle->Margin[i] * ry + 0.5);
|
||||||
curStyle->MarginV = int(curStyle->MarginV * ry + 0.5);
|
|
||||||
curStyle->UpdateData();
|
curStyle->UpdateData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue