Questions tagged [bounds]

In user interfaces and graphics, bounds refer to the size and location of a window or view.

In user interfaces and graphics, bounds refers to the size and location of a window or view. In 2D graphics, this is broken down into four parts. Combinations often used include:

  • x-location, y-location, width, and height.
  • x-location, y-location, right, bottom.

Likewise, in 3D graphics, bounds are often broken into 6 components:

  • x, y, z, width, height, depth
769 questions
17
votes
11 answers

self.view.bounds.size.width return wrong value

I am facing a very strange problem now. Getting [[self view] bounds].size.width always 320 it's not changing according to the device. iPhone 5, 6 & 6 Plus for all it's return 320.000000 in below all methods. - (void)viewDidLoad { [super…
Tapas Pal
  • 7,073
  • 8
  • 39
  • 86
16
votes
6 answers

Should I use std::vector::at() in my code

I noticed today that std::vector::at() is significantly slower than accessing values with square brackets []. According to the doc .at() is safer because it won't let me access values beyond the bounds of the array. However, even if I access out of…
laurent
  • 88,262
  • 77
  • 290
  • 428
16
votes
4 answers

C++: Vector bounds

I am coming from Java and learning C++ in the moment. I am using Stroustrup's Progamming Principles and Practice of Using C++. I am working with vectors now. On page 117 he says that accessing a non-existant element of a vector will cause a runtime…
lekroif
  • 992
  • 3
  • 12
  • 24
15
votes
3 answers

Set Map Bounds with different padding

I want to know if ther is any way of set different padding from each site of the Device for Google maps bounds. Because I have an mpview witch match the whole activity, but I have a MapOverlay (some Text inside a linerar Layout with non transulent…
MEX
  • 2,664
  • 5
  • 22
  • 28
14
votes
3 answers

Checking the int limits in stoi() function in C++

I have been given a string y in which I'm ensured that it only consists digits. How do I check if it exceeds the bounds of an integer before storing it in an int variable using the stoi function? string y = "2323298347293874928374927392374924" int x…
Manmeet Saluja
  • 147
  • 1
  • 2
  • 6
12
votes
3 answers

google maps. how to create a LatLngBounds rectangle (square) given coords of a central point

I have a point (X,Y) and I want to create a square , Google maps LatLngBounds object so to make geocode requests bias only into this LatLngBound region. How can I create such a LatLngBounds square with center the given point? I have to find the NE…
maiky
  • 3,503
  • 7
  • 28
  • 28
12
votes
6 answers

Getting string size in java (without having a Graphics object available)

I'm trying to write application which need to draw many strings using Graphics2D class in Java. I need to get sizes of each String object (to calculate exact position of each string). There are so many strings that it should be done before the…
Lukasz Spas
  • 595
  • 2
  • 9
  • 23
12
votes
1 answer

NSView equivalent of UIView Clip Subviews?

Is there a way to disable clipping of subviews of NSView? In UIView there is a “clip subviews checkbox” and the backing clipToBounds property, but I cant find anything similar in Cocoa. Here is my scenario: I have this grey dot that you can drag…
user961889
  • 351
  • 2
  • 12
11
votes
1 answer

Google Maps v3 adjust zoom level after map has been initialised

I am initialising a google map and periodicaly (every 30 seconds) updating markers/infowindows on the map. I am using Bounds to automatically zoom in but ensure that all markers/infowindows are visible. My problem is that the infowindows are placed…
Jono
  • 195
  • 2
  • 3
  • 13
11
votes
3 answers

In Java, why can't an array be a Type Variable's bound, but can be a Wildcard's bound?

In Java, why can't an array be a Type Variable's bound, but can be a Wildcard's bound? You can have: List< ? extends Integer[] > l; but you can't have: class MyClass< T extends Integer[] > { } // ERROR! Why?
John Assymptoth
  • 8,227
  • 12
  • 49
  • 68
11
votes
2 answers

When using covariance notations or generic bounds in Scala

In Scala variance can be defined with variance operators like + and - on the generic type argument. For example the List type is covariant in the standard library. class List[+A] So a function with a covariant list can be defined like this: def…
Julian
  • 33,915
  • 22
  • 119
  • 174
10
votes
2 answers

What's exactly viewDidLayoutSubviews?

I was reading the description of viewDidLayoutSubviews of UIViewController: Called to notify the view controller that its view has just laid out its subviews [...] However, this method being called does not indicate that the individual layouts of…
MartinMoizard
  • 6,600
  • 12
  • 45
  • 75
10
votes
3 answers

Could random.randint(1,10) ever return 11?

When researching for this question and reading the sourcecode in random.py, I started wondering whether randrange and randint really behave as "advertised". I am very much inclined to believe so, but the way I read it, randrange is essentially…
Tim Pietzcker
  • 328,213
  • 58
  • 503
  • 561
10
votes
1 answer

Google Maps Static API - Get SW and NE by center coordinate

I'm loading map tiles from Google Maps using Static Maps, using .NET. The problem I'm having is that I don't know what the SW and NE coordinates are of the returned image. I've found many different code samples, formulas, but they all seem to be…
Rik De Peuter
  • 703
  • 2
  • 9
  • 24
9
votes
3 answers

How to place Ant Design Table in parent container bounds under React?

I develop a SPA application and I wish place table in parent element bounds but I can't set explicit height. I can set scroll.y of table body but then result total height is large by header height. I can't get header height to calculate total needed…
Pavel Aristarkhov
  • 158
  • 1
  • 1
  • 7
1
2
3
51 52