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
3
votes
1 answer

How to test if pointer inside an array?

I would like to test if myCurrentPtr points inside my array a. _B represents the number of values in a. So, a + _B shall point the latest value of the array. #define _B ((uint8_t)5) volatile uint8_t a[5] = {0, 1, 2, 3, 4}; //`a` is a pointer to the…
TheJeje20
  • 43
  • 5
3
votes
2 answers

Fortran doesn't keep lower/upper array bounds after copy to another allocatable array

This doesn't work program main implicit none integer :: nx = 3 integer :: ny = 5 integer :: nz = 8 real, allocatable, dimension(:,:,:) :: A real, allocatable, dimension(:,:) :: B allocate(A(nx,0:ny,nz) ) ! ...do something…
3
votes
4 answers

gnuplot -- plot range different from axes range

I have this very simple, working gnuplot code: splot x * x This plots a surface from -10 < x < 10 and -10 < y < 10. I want to plot the same surface from -10 < x < 10 and -10 < y < -9 HOWEVER I still want the graph's axes to use -10 < x < 10 and…
sudo rm -rf slash
  • 1,156
  • 2
  • 16
  • 27
3
votes
1 answer

Property observers for UIView bounds and frame react differently

While I am exploring the option to observe a UIView's bounds or frame change (mentioned here and here), I have encountered a very strange discrepancy: didSet and willSet will be triggered differently based on where you put your UIView in the view…
HuaTham
  • 7,486
  • 5
  • 31
  • 50
3
votes
3 answers

In Java, Type Variables' bounds can only be present in the Type Variable declaration, right?

Type Variables' bounds can only appear in the declaration of classes, interface, methods and constructors? Or can I bound a type variable when they are used as type arguments? Edit: Example: class MyClass { // T is bounded by the…
John Assymptoth
  • 8,227
  • 12
  • 49
  • 68
3
votes
2 answers

Defining bounded integers in z3

Is there a smart way to define bounded integers in Z3? For example, lets say I want to define an integer variable "x" that can take values from [1,4]. I can do the following (I am using the Java API) IntExpr x =…
Mohammed
  • 134
  • 6
3
votes
4 answers

Should a boolean value be truncated to either true or false when assigned?

I've found a difference in the value stored in a bool variable (btw Visual-C++ and clang++), in the case where the stored value is neither true nor false (if it was corrupted somehow), and I'm not sure if it's a Visual-C++ bug or if it's just UB I…
Chris
  • 136
  • 7
3
votes
1 answer

Swift SpriteKit Create a border where only three sides are passable

I am trying to create a game where the user plays by shooting balls. I want the balls to bounce off the top border and the side borders. The ball is initially placed at the bottom border, and when the user touches a spot, the ball goes in that…
at26
  • 63
  • 5
3
votes
2 answers

How to get the visible bounds of a panel

I have a panel that may or may not be within other panels. I'm trying to work out the visible bounds of that panel. I thought the GetWindowRect or the GetClientRect would do the trick but no joy. To test this I've created a form with a panel and…
AidanO
  • 868
  • 1
  • 11
  • 33
3
votes
2 answers

Calculate bounds of a box including rotation

I am working on collision system for my game that uses custom colliders. I used this to create bounding box for collisions. I am getting problem for the boxes where right and forward values have been used to create box. Otherwise its working fine.…
bhupinder
  • 315
  • 1
  • 6
  • 23
3
votes
2 answers

Swift SpriteKit get visible frame size

I have been trying to create a simple SpriteKit app using Swift. The purpose is to have a red ball re-locate itself on the screen when clicked on. But the variables self.frame.width and self.frame.height do not return the boundaries of the visible…
orkun1675
  • 171
  • 1
  • 8
3
votes
1 answer

limit the bounds for google maps api search to only one area

I would like to limit the search results for my google map to within a specific latLngBounds range. places search api - lists this this addListener function to change the bounds: google.maps.event.addListener(map, 'bounds_changed', function() { var…
MrGoodfellow
  • 89
  • 1
  • 9
3
votes
1 answer

google map map.fitBounds() and bounds.extend() are not working as expected.

I have a piece of code below which is using bounds.extend() and map.fitBounds() to resize the map to accommodate all markers. I would expect the map could focus to start_point as a center and zoom out to a appropriate level so every markers would…
3
votes
1 answer

Get draw bounds/rect of a view

I'm developing an app where a lot of views can be rotated - it's something like a map of physical objects. I have to detect when 2 objects (all objects are rectangles/squares) are overlapping and if a user has performed a single/double/long tap on…
Zheko
  • 673
  • 6
  • 16
3
votes
1 answer

How to make bounds(collision rectangle) smaller size than the sprite in LibGDX

Title says it all pretty much. I want the hitbox to be slightly smaller than the player character sprite, so he'd be hugging the walls a bit closer (even overlapping a bit) and not dying to bullets that only barely hit him. I am able to change the…
Steve Waters
  • 3,348
  • 9
  • 54
  • 94