{
if(block.type == FONT || block.type == ANCHOR)
{
- surface.TextFont(block.prevFont.font.font);
+ surface.TextFont(block.parent.font.font);
if(flags.render)
- surface.SetForeground(block.prevFont.textColor);
+ surface.SetForeground(block.parent.textColor);
}
block = block.next;
break;
}
+ //if(block)
+ {
+ if(block.type == FONT || block.type == ANCHOR)
+ {
+ surface.TextFont(block.parent.font.font);
+ if(flags.render)
+ surface.SetForeground(block.parent.textColor);
+ }
+ }
block = block.parent;
// Getting out of a block
if(block)
{
- if(block.type == FONT || block.type == ANCHOR)
+ /*if(block.type == FONT || block.type == ANCHOR)
{
surface.TextFont(block.prevFont.font.font);
if(flags.render)
surface.SetForeground(block.prevFont.textColor);
}
- else if(block.type == CENTER)
+ else */if(block.type == CENTER)
{
if(centered)
(*centered)--;
return block;
}
-int ComputeLine(Surface surface, Block startBlock, int startTextPos, Block * nextBlock, int * nextTextPos, int * centered, int * w,
+int ComputeLine(Surface surface, Block startBlock, int startTextPos, Block * nextBlock, int * nextTextPos, int * centered, int * w,
int maxW, int maxH, uint flags, int y, OldList leftObjects, OldList rightObjects, bool * changeLine, bool computeStartY, int sy, int sx)
{
int h = 0;
if(block.window)
{
width += block.window.size.w;
- height = Max(height, block.window.size.h);
+ height = Max(height, Max(26, block.window.size.h));
}
break;
}
surface.TextExtent(" ", 1, null, &th);
height = Max(height, th);
-
for(; textPos<block.textLen && !lineComplete;)
{
int w;
len = (nextSpace - (text + textPos)) + 1;
else
len = block.textLen - textPos;
-
+
surface.TextExtent(text + textPos, len, &w, &th);
if(x + width + w > maxW && x > 0)
}
else if(block.halign == left || block.halign == right)
{
+ Font font = surface.font;
ComputeTable(surface, block, textPos, &width, &height, maxW, maxH, flags, y + sy, x + sx);
+ surface.font = font;
x += width;
-
+
*nextBlock = NextBlockUp(surface, block, centered, flags);
*nextTextPos = 0;
h = Max(h, height);
}
else
{
+ Font font = surface.font;
ComputeTable(surface, block, textPos, &width, &height, maxW, maxH, flags, y + sy, x + sx);
+ surface.font = font;
lineComplete = true;
*nextBlock = NextBlockUp(surface, block, centered, flags);
*nextTextPos = 0;
{
int textPos = startTextPos;
Block block = startBlock;
- bool lineComplete = false;
int startSel, endSel;
Block startSelBlock = null, endSelBlock = null;
if(browser.textBlock != browser.selBlock || browser.curPosition != browser.selPosition)
{
surface.Bevel(false, dx, dy, bw, bh);
if(browser.missing.bitmap)
- surface.Blit(browser.missing.bitmap, dx + 5, dy + 5, 0,0,
+ surface.Blit(browser.missing.bitmap, dx + 5, dy + 5, 0,0,
browser.missing.bitmap.width, browser.missing.bitmap.height);
}
surface.SetForeground(fg);
break;
case TABLE:
RenderTable(browser, surface, x, y, w, h, left, right, block);
- lineComplete = true;
block = NextBlockUp(surface, block, null, RenderFlags { render = true });
textPos = 0;
break;
}
}
-bool PickLine(HTMLView browser, Surface surface, int x, int y, int w, int h, Block startBlock, int startTextPos,
+bool PickLine(HTMLView browser, Surface surface, int x, int y, int w, int h, Block startBlock, int startTextPos,
Block endBlock, int endTextPos, int left, int right, int pickX, int pickY, Block* pickBlock, int * pickTextPos)
{
bool result = false;
int textPos = startTextPos;
Block block = startBlock;
- bool lineComplete = false;
for(;!result;)
{
break;
case TABLE:
result = PickTable(browser, surface, x, y, w, h, left, right, block, pickX, pickY, pickBlock, pickTextPos);
- lineComplete = true;
block = NextBlockUp(surface, block, null, RenderFlags { render = true });
textPos = 0;
break;
return result;
}
-
-void PositionLine(HTMLView browser, Surface surface, int x, int y, int w, int h, Block startBlock, int startTextPos,
+
+void PositionLine(HTMLView browser, Surface surface, int x, int y, int w, int h, Block startBlock, int startTextPos,
Block endBlock, int endTextPos, int left, int right)
{
int textPos = startTextPos;
Block block = startBlock;
- bool lineComplete = false;
for(;;)
{
{
Window parent = block.window.parent;
block.window.Move(
- x + parent.scroll.x, y + parent.scroll.y,
+ x + parent.scroll.x, y + parent.scroll.y,
block.window.size.w, block.window.size.h);
//block.window.visible = false;
x += block.window.size.w;
- if(block.inputType == text)
- {
- printf("");
- }
}
break;
}
case IMAGE:
{
int bw = block.pWidth ? (w * block.pWidth / 100) : block.w;
- int bh = block.pHeight ? (h * block.pHeight / 100) : block.h;
- int dx, dy;
+ //int bh = block.pHeight ? (h * block.pHeight / 100) : block.h;
+ int dx;//, dy;
switch(block.halign)
{
break;
}
+ /*
switch(block.valign)
{
case bottom: dy = y + h - bh; break;
case top: dy = y; break;
case middle: dy = y + (h - bh) / 2; break;
}
+ */
x += bw;
break;
break;
case TABLE:
PositionTable(browser, surface, x, y, w, h, left, right, block);
- lineComplete = true;
block = NextBlockUp(surface, block, null, RenderFlags { render = true });
textPos = 0;
break;