mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 14:35:03 +01:00
fixed untouchable links
This commit is contained in:
parent
e3594f37d8
commit
ee38ecec56
2 changed files with 5 additions and 1 deletions
|
@ -425,6 +425,7 @@ public class MessageObject {
|
||||||
|
|
||||||
int blocksCount = (int)Math.ceil((float)linesCount / LINES_PER_BLOCK);
|
int blocksCount = (int)Math.ceil((float)linesCount / LINES_PER_BLOCK);
|
||||||
int linesOffset = 0;
|
int linesOffset = 0;
|
||||||
|
float prevOffset = 0;
|
||||||
|
|
||||||
for (int a = 0; a < blocksCount; a++) {
|
for (int a = 0; a < blocksCount; a++) {
|
||||||
|
|
||||||
|
@ -449,6 +450,9 @@ public class MessageObject {
|
||||||
block.textYOffset = textLayout.getLineTop(linesOffset);
|
block.textYOffset = textLayout.getLineTop(linesOffset);
|
||||||
if (a != blocksCount - 1) {
|
if (a != blocksCount - 1) {
|
||||||
blockHeight = Math.min(blockHeight, block.textLayout.getHeight());
|
blockHeight = Math.min(blockHeight, block.textLayout.getHeight());
|
||||||
|
prevOffset = block.textYOffset;
|
||||||
|
} else {
|
||||||
|
blockHeight = Math.min(blockHeight, (int)(block.textYOffset - prevOffset));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
FileLog.e("tmessages", e);
|
FileLog.e("tmessages", e);
|
||||||
|
|
|
@ -40,8 +40,8 @@ public class ChatMessageCell extends ChatBaseCell {
|
||||||
int x = (int)event.getX();
|
int x = (int)event.getX();
|
||||||
int y = (int)event.getY();
|
int y = (int)event.getY();
|
||||||
if (x >= textX && y >= textY && x <= textX + currentMessageObject.textWidth && y <= textY + currentMessageObject.textHeight) {
|
if (x >= textX && y >= textY && x <= textX + currentMessageObject.textWidth && y <= textY + currentMessageObject.textHeight) {
|
||||||
int blockNum = Math.max(0, y / currentMessageObject.blockHeight);
|
|
||||||
y -= textY;
|
y -= textY;
|
||||||
|
int blockNum = Math.max(0, y / currentMessageObject.blockHeight);
|
||||||
if (blockNum < currentMessageObject.textLayoutBlocks.size()) {
|
if (blockNum < currentMessageObject.textLayoutBlocks.size()) {
|
||||||
MessageObject.TextLayoutBlock block = currentMessageObject.textLayoutBlocks.get(blockNum);
|
MessageObject.TextLayoutBlock block = currentMessageObject.textLayoutBlocks.get(blockNum);
|
||||||
x -= textX - (int)Math.ceil(block.textXOffset);
|
x -= textX - (int)Math.ceil(block.textXOffset);
|
||||||
|
|
Loading…
Reference in a new issue