}
}
+ void NormalizeSelection(Block * startBlock, int * startSel, Block * endBlock, int * endSel)
+ {
+ bool selAfter = false;
+ Block b;
+ for(b = selBlock; b; b = GetNextBlock(b))
+ {
+ if(b != selBlock && b == textBlock)
+ {
+ selAfter = true;
+ break;
+ }
+ }
+
+ if(textBlock == selBlock)
+ {
+ *startSel = Min(selPosition, curPosition);
+ *endSel = Max(selPosition, curPosition);
+ *startBlock = *endBlock = textBlock;
+ }
+ else if(!selAfter)
+ {
+ *startBlock = textBlock;
+ *startSel = curPosition;
+ *endSel = selPosition;
+ *endBlock = selBlock;
+ }
+ else
+ {
+ *startBlock = selBlock;
+ *startSel = selPosition;
+ *endSel = curPosition;
+ *endBlock = textBlock;
+ }
+ }
+
void PositionForms()
{
Block block = html.body;
}
}
+ // For text selection
+ Block textBlock, selBlock;
+ int curPosition, selPosition;
+ bool isSelected; // Persistent state changed by RenderLine
+
void OnRedraw(Surface surface)
{
Block block = html.body;
if(html.defaultFont.font) // TOFIX: Null! (No font set?)
surface.TextFont(html.defaultFont.font.font);
surface.SetForeground(html.defaultFont.textColor);
+ isSelected = false;
for(;block;)
{
//h = Max(h, newH);
RenderLine(this, surface, x - scroll.x, y - scroll.y, maxW, newH, block, textPos, nextBlock, nextTextPos, left - scroll.x, right - scroll.x);
+
if(changeLine)
{
// y += h;