Commit e19640f9 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

1/4mm from margin

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55936 954022d7-b5bf-4e40-9824-e11837661b57
parent d52e33a9
......@@ -68,11 +68,15 @@ function CVerRulerRepaintChecker()
this.BlitTop = 0;
}
function RulerCorrectPosition(val, mm_1_8, mm_1_4)
function RulerCorrectPosition(val, mm_1_8, mm_1_4, margin)
{
if (global_keyboardEvent.AltKey)
return val;
return (((val + mm_1_8) / mm_1_4) >> 0) * mm_1_4;
if (undefined === margin)
return (((val + mm_1_8) / mm_1_4) >> 0) * mm_1_4;
return margin + (((val - margin + mm_1_8) / mm_1_4) >> 0) * mm_1_4;
}
function CHorRuler()
......@@ -744,7 +748,7 @@ function CHorRuler()
}
case 1:
{
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4);
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4, _margin_left);
if (newVal < 0)
newVal = 0;
......@@ -770,7 +774,7 @@ function CHorRuler()
}
case 2:
{
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4);
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4, _margin_left);
var min = this.m_dMarginLeft;
if ((this.m_dMarginLeft + this.m_dIndentLeft) > min)
......@@ -798,7 +802,7 @@ function CHorRuler()
}
case 3:
{
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4);
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4, _margin_left);
var min = 0;
if (this.m_dIndentLeftFirst < this.m_dIndentLeft)
......@@ -830,7 +834,7 @@ function CHorRuler()
}
case 4:
{
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4);
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4, _margin_left);
if (newVal < 0)
newVal = 0;
......@@ -852,7 +856,7 @@ function CHorRuler()
}
case 5:
{
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4);
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4, _margin_left);
if (newVal < 0)
newVal = 0;
......@@ -874,7 +878,7 @@ function CHorRuler()
}
case 6:
{
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4);
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4, _margin_left);
if (newVal > (this.m_oPage.width_mm))
newVal = this.m_oPage.width_mm;
......@@ -900,7 +904,7 @@ function CHorRuler()
}
case 7:
{
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4);
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4, _margin_left);
this.m_dCurrentTabNewPosition = newVal - _margin_left;
......@@ -924,7 +928,7 @@ function CHorRuler()
}
case 8:
{
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4);
var newVal = RulerCorrectPosition(_x, mm_1_8, mm_1_4, _margin_left);
// сначала определим граничные условия
var _min = 0;
......@@ -1195,7 +1199,7 @@ function CHorRuler()
var mm_1_4 = 10 / 4;
var mm_1_8 = mm_1_4 / 2;
var _new_tab_pos = RulerCorrectPosition(_new_tab_pos, mm_1_8, mm_1_4);
var _new_tab_pos = RulerCorrectPosition(_new_tab_pos, mm_1_8, mm_1_4, _margin_left);
this.m_arrTabs[this.m_arrTabs.length] = new CTab(_new_tab_pos, word_control.m_nTabsType);
//this.CorrectTabs();
......@@ -2240,7 +2244,7 @@ function CVerRuler()
}
case 1:
{
var newVal = RulerCorrectPosition(_y, mm_1_8, mm_1_4);
var newVal = RulerCorrectPosition(_y, mm_1_8, mm_1_4, this.m_dMarginTop);
if (newVal > (this.m_dMarginBottom - 30))
newVal = this.m_dMarginBottom - 30;
......@@ -2259,7 +2263,7 @@ function CVerRuler()
}
case 2:
{
var newVal = RulerCorrectPosition(_y, mm_1_8, mm_1_4);
var newVal = RulerCorrectPosition(_y, mm_1_8, mm_1_4, this.m_dMarginTop);
if (newVal < (this.m_dMarginTop + 30))
newVal = this.m_dMarginTop + 30;
......@@ -2278,7 +2282,7 @@ function CVerRuler()
}
case 3:
{
var newVal = RulerCorrectPosition(_y, mm_1_8, mm_1_4);
var newVal = RulerCorrectPosition(_y, mm_1_8, mm_1_4, this.m_dMarginTop);
if (newVal > this.header_bottom)
newVal = this.header_bottom;
......@@ -2297,7 +2301,7 @@ function CVerRuler()
}
case 4:
{
var newVal = RulerCorrectPosition(_y, mm_1_8, mm_1_4);
var newVal = RulerCorrectPosition(_y, mm_1_8, mm_1_4, this.m_dMarginTop);
if (newVal < 0)
newVal = 0;
......@@ -2329,7 +2333,7 @@ function CVerRuler()
_max = this.m_oTableMarkup.Rows[this.DragTablePos].Y + this.m_oTableMarkup.Rows[this.DragTablePos].H;
}
var newVal = RulerCorrectPosition(_y, mm_1_8, mm_1_4);
var newVal = RulerCorrectPosition(_y, mm_1_8, mm_1_4, this.m_dMarginTop);
if (newVal < _min)
newVal = _min;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment