Questions tagged [getclientrect]
17 questions
4
votes
2 answers
How can I get a line height from font size within browser?
Range.getClientRects() method returns a list of ClientRect occupied by range and this works well when the range is within normal span which has text.
Hello!
But it fails…
ntalbs
- 28,700
- 8
- 66
- 83
2
votes
0 answers
javascript check if element rect hitting another with same class
I want to put like 30 of
elements with random size and random position inside the
container, but none of the .anger hitting one another.
Is it possible?
This is my code so far:
function loadAngers() {
var wrp =…

Taufik Nur Rahmanda
- 1,862
- 2
- 20
- 36
2
votes
0 answers
getClientRects() from window.getSelection()
I've tried reading the official documentation, and I'm sure this is possible - I'm just struggling with how to do it.
How can I fetch the coordinates, width and height from some text that's been selected by the user? (By 'selected text', I mean text…

Steviewevie
- 189
- 1
- 13
2
votes
2 answers
Problem with adding graphics to TLabel
I'm trying to create with Delphi a component inherited from TLabel, with some custom graphics added to it on TLabel.Paint. I want the graphics to be on left side of text, so I overrode GetClientRect:
function TMyComponent.GetClientRect:…

Harriv
- 6,029
- 6
- 44
- 76
1
vote
1 answer
Alternative to GetClientRect?
I am monitoring DirectX application that is in windowed mode on Vista. GetClientRect reports correct size until application is minimized and restored then it always returns the preview size (106x160).
Is there any other way to query window for…

Max OfLondon
- 104
- 9
1
vote
0 answers
Get clientRect of a specific text in contenteditable?
I'm trying to place a tooltip on top of a text selected via index.
Hello, my *name is John Doe
^ get the clientRect from index 10 to 14
Words area marked with a asterisk
I coulnd't find a way or I didnt google properly to get the…

ekclone
- 1,030
- 2
- 17
- 39
1
vote
1 answer
VB.NET GetClientRect() returns nothing for child process in WinForm
Writing a WinForm project in VB.NET on VS 2017, and I am opening an instance of FreeRDP in SplitContainer2.Panel1. This works just fine, but I would like to scale the form to initially fit the FreeRDP window. In order to do this, I first need to…

Mako-Wish
- 303
- 2
- 12
1
vote
0 answers
range getClientRects(), getBoundingClientRect() wrong when empty anchor is in HTML paragraph
I found a possibly weird behaviour of getClientRects() [getBoundingClientRect()]:
Look at this HTML code:
[Note that the a element has no text inside, I tested…

P5music
- 3,197
- 2
- 32
- 81
0
votes
1 answer
does Android WebView support getClientRects? Or there is a bug?
I found that Javascript method getClientRects always yields an array of 1 element only, even when it is called for multiple lines p, for example. I expect as many rects as many lines the p was displayed over because it is longer than a single line.…

P5music
- 3,197
- 2
- 32
- 81
0
votes
1 answer
elem.getBoundingClientRect() broken on mobile screen
I'm developing a website using gatsby.js and it involves a slide-in animation as you scroll down. I wrote code that worked perfectly until I opened dev tools and tried it using the device toolbar.
here's a reproduction demo as well as a webpage to…

Arfizato
- 1
- 2
0
votes
1 answer
MFC GetClientRect/GetWindowRect after a MoveWindow
m_PICTURE_OD is an IDC_STATIC,
m_PICTURE_OD.MoveWindow(640 /*x*/,96/*y*/,480/*w*/,288/*h*/);
RECT myrect;
m_PICTURE_OD.GetClientRect(&myrect);
myrect.bottom = 288;
myrect.top = 0;
myrect.left = 0;
myrect.right = 480;
RECT…

Simon
- 277
- 1
- 5
- 13
0
votes
0 answers
CView::OnInitialUpdate() gives me lower width and height
Using the GetClientRect inside the CView::OnInitialUpdate() gives me lower values in Width and the Height than using the same code inside the CView::OnSize.
ie
Inside OnInitialUpdate I get
tagRECT = {top=0 bottom=468 left=0 right=1009}
while…

Maverick
- 1,105
- 12
- 41
0
votes
0 answers
Javascript: explicitly closing tags like with DOM manipulation
My Android app makes use of a WebView control where an HTML page is loaded. I am experiencing wrong behaviour of certain functions like range.getClientRects() when an user selects a range surrounding an empty anchor element like:

P5music
- 3,197
- 2
- 32
- 81
0
votes
0 answers
COleControl GetClientRect returns area with bottom as 0
I have a control derived from COleControl. When loading this control , it calls OnSize, Within OnSize I am getting ClientRect area by calling GetClientRect and moving the control to the area got from GetClientRect.
First time when initializing the…

srajeshnkl
- 883
- 3
- 16
- 49
0
votes
3 answers
How to get the full client rect?
The GetClientRect function, according to MSDN, is actually only good for determining the client width & height, since left & top are always zero. Is there a way to get the complete client coordinates, including left & top (either in screen space, or…

sold
- 2,041
- 5
- 25
- 32