Last active
February 28, 2020 14:44
-
-
Save abbas-oveissi/4987020 to your computer and use it in GitHub Desktop.
sample C# code for socket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void drawSelection(Canvas canvas, int startChar, int endChar, int line) { | |
Rect rect = getTextRect(line); | |
float startX = layout.getPrimaryHorizontal(startChar ); | |
float endX = 0; | |
int maxPosLine = layout.getLineEnd(line); | |
if (endChar >= maxPosLine) | |
endX= rect.right; | |
else | |
endX= layout.getPrimaryHorizontal(endChar ); | |
Rect drawRect = new Rect((int)startX,rect.top,(int)endX,rect.bottom); | |
canvas.drawRect(drawRect, paint); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment