mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Fixed nasty problem with RichText paragraph ruler
git-svn-id: svn://ultimatepp.org/upp/trunk@860 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
67a5b4db82
commit
490ff74fcd
3 changed files with 11 additions and 11 deletions
|
|
@ -155,6 +155,10 @@ void RichPara::Paint(PageDraw& pw, const Rect& page, PageY py, const PaintInfo&
|
|||
bool highlight = pi.highlightpara >= 0 && pi.highlightpara < pl.len;
|
||||
int hy = py.y - format.before - format.ruler;
|
||||
int phy = py.page;
|
||||
if(format.ruler && hy >= 0 && hy + format.ruler < page.bottom)
|
||||
pw.Page(phy).DrawRect(z * page.left + z * format.lm, z * hy,
|
||||
z * page.right - z * page.left - z * format.rm - z * format.lm,
|
||||
max(1, z * format.ruler), format.rulerink);
|
||||
if(pi.sell < 0 && pi.selh > 0)
|
||||
for(int p = opy.page; p <= py.page; p++) {
|
||||
int top = z * (p == opy.page ? opy.y : page.top);
|
||||
|
|
@ -361,10 +365,6 @@ void RichPara::Paint(PageDraw& pw, const Rect& page, PageY py, const PaintInfo&
|
|||
pw.Page(py.page).DrawRect(z * page.left, top, z * page.right - z * page.left,
|
||||
z * min(py.y + format.after, page.bottom) - top, InvertColor);
|
||||
}
|
||||
if(format.ruler && hy >= 0 && hy + format.ruler < page.bottom)
|
||||
pw.Page(phy).DrawRect(z * page.left + z * format.lm, z * hy,
|
||||
z * page.right - z * page.left - z * format.rm - z * format.lm,
|
||||
max(1, z * format.ruler), format.rulerink);
|
||||
}
|
||||
|
||||
void RichPara::GetRichPos(RichPos& rp, int pos) const
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ PageY RichTxt::GetNextPageY(int parti, const RichContext& rc) const
|
|||
py.page++;
|
||||
py.y = rc.page.top;
|
||||
}
|
||||
py.y += pp.before;
|
||||
py.y += pp.before + pp.ruler;
|
||||
if(py.y + pp.cy < rc.page.bottom)
|
||||
py.y += pp.cy;
|
||||
else
|
||||
|
|
@ -98,7 +98,7 @@ PageY RichTxt::GetNextPageY(int parti, const RichContext& rc) const
|
|||
}
|
||||
}
|
||||
else
|
||||
py.y += pp.before + pp.cy + pp.after;
|
||||
py.y += pp.before + pp.cy + pp.after + pp.ruler;
|
||||
return py;
|
||||
}
|
||||
}
|
||||
|
|
@ -194,7 +194,7 @@ RichCaret RichTxt::GetCaret(int pos, RichContext rc) const
|
|||
if(p.keepnext && parti + 1 < part.GetCount() && part[parti + 1].Is<Para>()) {
|
||||
Sync(parti + 1, rc);
|
||||
const Para& pp = part[parti + 1].Get<Para>();
|
||||
nbefore = pp.before;
|
||||
nbefore = pp.before + pp.ruler;
|
||||
nline = pp.linecy[0];
|
||||
}
|
||||
RichCaret tp = Get(parti, rc.styles).GetCaret(pos, rc.page, rc.py, nbefore, nline);
|
||||
|
|
@ -230,7 +230,7 @@ int RichTxt::GetPos(int x, PageY y, RichContext rc) const
|
|||
if(part[parti].Get<Para>().keepnext && parti + 1 < part.GetCount() && IsPara(parti + 1)) {
|
||||
Sync(parti + 1, rc);
|
||||
const Para& pp = part[parti + 1].Get<Para>();
|
||||
nbefore = pp.before;
|
||||
nbefore = pp.before + pp.ruler;
|
||||
nline = pp.linecy[0];
|
||||
}
|
||||
return Get(parti, rc.styles).GetPos(x, y, rc.page, rc.py, nbefore, nline) + pos;
|
||||
|
|
@ -325,7 +325,7 @@ void RichTxt::GatherValPos(Vector<RichValPos>& f, RichContext rc, int pos, int t
|
|||
if(p.keepnext && parti + 1 < part.GetCount() && IsPara(parti + 1)) {
|
||||
Sync(parti + 1, rc);
|
||||
const Para& pp = part[parti + 1].Get<Para>();
|
||||
nbefore = pp.before;
|
||||
nbefore = pp.before + pp.ruler;
|
||||
nline = pp.linecy[0];
|
||||
}
|
||||
if(p.haspos)
|
||||
|
|
@ -355,7 +355,7 @@ PageY RichTxt::GetTop(RichContext rc) const
|
|||
else {
|
||||
Sync(0, rc);
|
||||
const Para& pp = part[0].Get<Para>();
|
||||
rc.py.y += pp.before;
|
||||
rc.py.y += pp.before + pp.ruler;
|
||||
if(BreaksPage(rc.py, pp, 0, rc.page))
|
||||
rc.Page();
|
||||
return rc.py;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ topic "QTF";
|
|||
texts).&]
|
||||
[s0; &]
|
||||
[s0; It is byte oriented format. Bytes with values 2`-31 are ignored.
|
||||
Other are interpreted as characters or formatting commands.&]
|
||||
Other values are interpreted as characters or formatting commands.&]
|
||||
[s0; &]
|
||||
[s0; Letters ([@4 a]`-[@4 zA]`-[@4 Z]), numbers ([@4 0]`-[@4 9]), space (32)
|
||||
and characters&]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue