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
2
votes
0 answers

Keep ImageView Within Bounds of Screen Swift

I am using the code below to keep an imageView/player inside the screen. The code works for the most part, but at times, the player flies off the screen and completely disappears. I am using UIPanGestureRecognizer to move the image around the…
Alicia
  • 41
  • 5
2
votes
2 answers

Calculate if circle fits inside of polygon (triangle/pentagon) given coordinates where touching the polygon is allowed?

Given a circle with center (Xc,Yc) and radius r as well as a polygon with vertices inside of an array such that vertices[] = { (Xv1, Yv1) , ... , (Xvn, Yvn) } where n is the number of vertices. I want to be able to figure out if the circle is…
Gabe
  • 105
  • 2
  • 9
2
votes
1 answer

Boost.Spirit.Qi - Bounds checking against primitive data types

I need to check that the value of a parsed qi::uint_ is less than 256. I stumbled across an SO post outlining the following syntax to run checks after a primitive type has been parsed (qi::double_ in this example). raw [ double_ [_val = _1] ] […
Zak
  • 12,213
  • 21
  • 59
  • 105
2
votes
1 answer

UIScreen's nativeBounds tells the wrong resolution for 4K TV

I have an Apple TV 4K (tvOS 11.1) connected to a 4K TV display and set Apple TV to 4K SDR 60Hz in Settings. When I print [UIScreen mainScreen].nativeBounds, it prints out 1920x1080 instead of 3840x2160. Does anyone know why ?
JoJo Lin
  • 21
  • 3
2
votes
3 answers

determining whether a window is in desktop bounds c++

I wrote some code to determinate whether a certain window is inside the desktop bounds. Somehow, it doesn't work. For every window, regardless whether it is inside or outside the desktop, false is returned. Something is terribly wrong here, but…
alex
  • 1,228
  • 1
  • 16
  • 38
2
votes
1 answer

Unity: Collider.bounds.extends.x returns radius since latest update - why?

today I updated my project to version 2017.2.0f3 (was working on 2017.1.1f1 before). This... offsetX = objectCollider.bounds.extents.x; ...used to return the bounds in world space of my SphereCollider, but now it only returns the radius of the…
Pft
  • 23
  • 3
2
votes
0 answers

Google Maps Android API: How to limit the camera of a map to specific bounds?

I want to limit the camera of a Google Map (Google Maps Android API v2) to a specific area (described as latlng bounds). I know that I can limit the movement of the camera with: setLatLngBoundsForCameraTarget(bounds). But this only affects the…
Marcel Gangwisch
  • 8,856
  • 4
  • 23
  • 32
2
votes
0 answers

Swift 3 iOS -Override HitTest not letting SubView Receive Touches Outside it's SuperView's Bounds

I have a collectionView cell that has an imageView from StoryBoard and a deleteButton (the red X) added programmatically that extends beyond the cell's bounds x:-12, y:-18. I tried to override the hitTest to receive touches outside the cell's…
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
2
votes
2 answers

Swift iOS- How to Add Button to the outside a CollectionView Cell

I want to get a deleteButton that is a delete image to sit on the outside of a collectionViewCell (it can be partially inside). I looked at other SO answers and they said just play with the button's frame's Rect's x & y values which I did. When…
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
2
votes
2 answers

Scipy Optimize Curve_fit error for bounds

When I try to run: bet = (nu[minimum],10**4,3000,0,0,5000) # Array of initial bet parameters bound = ( (nu[0],nu[len(nu)-1]),(10**3,10**6),(-np.inf,np.inf),(-np.inf,np.inf),(-np.inf,np.inf),(-np.inf,np.inf) ) popt,pcov = curve_fit(S_21,x,y,…
Raizen
  • 99
  • 2
  • 10
2
votes
2 answers

Java Generics - Unexpected bounds

No Problems here public class MyList extends ArrayList { } . Unexcepted bound. What does this mean? And why is it wrong? Thanks for help. public class MyList extends ArrayList { }
hasNoPatience
  • 67
  • 2
  • 4
2
votes
2 answers

Why does a ArrayIndexOutOfBoundsException happen here?

I got the following code in my Android-App: Event[] events = retrieveEvents(); if (events != null && events.length>0) { int eventNr = getFromUserInput(); eventNr = eventNr % events.length; Event event = events[eventNr]; } retrieveEvents()…
theomega
  • 31,591
  • 21
  • 89
  • 127
2
votes
1 answer

error: incompatible types: inference variable R has incompatible bounds (Lambda java 8)

I have a Tree object that contains children (HashMap) of Tree objects and so on. I need to filter objects by numericPosition variable. For example: Tree mapTreeRoot = new Tree("Root",0); int answer = 111; mapTreeRoot …
Oyeme
  • 11,088
  • 4
  • 42
  • 65
2
votes
2 answers

How to limit sliding of the UISlider to a certain point?

I have a UISlider & UIProgressView to which I set a certain value. The slider handle then moves to a maximum value, as expected. UISlider and UIProgressview Image Now, I want to let the user slide the slider thumb to that red point. (as in the…
Aashish
  • 2,532
  • 2
  • 23
  • 28
2
votes
1 answer

How can we check if polyline exists within map bounds in leaflet

I am plotting the lines from geojson file on a leaflet map. Now I need to read the fetaures back which exist within the map bounds based on current view. I cam across this…
Nitesh Rai
  • 35
  • 1
  • 6