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;
len = (nextSpace - (text + textPos)) + 1;
else
len = block.textLen - textPos;
-
+
surface.TextExtent(text + textPos, len, &w, &th);
if(x + width + w > maxW && x > 0)
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);
{
int textPos = startTextPos;
Block block = startBlock;
- bool lineComplete = false;
int startSel, endSel;
Block startSelBlock = null, endSelBlock = null;
+ int prevGlyph = 0;
if(browser.textBlock != browser.selBlock || browser.curPosition != browser.selPosition)
browser.NormalizeSelection(&startSelBlock, &startSel, &endSelBlock, &endSel);
{
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);
int l = startSel - textPos;
if(block.text)
{
- surface.TextExtent(block.text + textPos, l, &tw, &th);
+ surface.TextExtent2(block.text + textPos, l, &tw, &th, prevGlyph, &prevGlyph, null);
surface.WriteText(x, y + h - th, block.text + textPos, l);
x += tw;
}
surface.foreground = white;
surface.textOpacity = true;
}
- surface.TextExtent(block.text + textPos, len, &tw, &th);
+ surface.TextExtent2(block.text + textPos, len, &tw, &th, prevGlyph, &prevGlyph, null);
surface.WriteText(x, y + h - th, block.text + textPos, len);
x += tw;
if(browser.isSelected)
int l = endPos - textPos;
if(block.text)
{
- surface.TextExtent(block.text + textPos, l, &tw, &th);
+ surface.TextExtent2(block.text + textPos, l, &tw, &th, prevGlyph, &prevGlyph, null);
surface.WriteText(x, y + h - th, block.text + textPos, l);
x += tw;
}
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;)
{
surface.TextExtent(block.text + textPos, len, &tw, &th);
// eSurface_WriteText(surface, x, y + h - th, block.text + textPos, len);
- if(pickX >= x && pickY >= y+h-th && pickX < x + tw && pickY < y+h)
+ if(block.text[0] == ' ' && block.text[1] == 0) pickX += tw; else
+ if(pickX >= x && pickY >= y+h-th && pickX < x + tw + 2 && pickY < y+h)
{
result = true;
*pickBlock = block;
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;