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

IOS interface views - best practices

I'm working right now at a complex user interface for a game which contains both IB elements and programmatic created elements. My question is about the best practices to be used when creating an interface: i know that i should avoid hard-coding…
Macaret
  • 797
  • 9
  • 33
2
votes
0 answers

Not getting the appropriate bounds after an image is rotated in WPF

I've tried several methods here on stackoverflow, and the closest one is the following: Border DesignBorder = new Border(); DesignBorder.BorderThickness = new System.Windows.Thickness(2.0); DesignBorder.BorderBrush = Brushes.Black; GeneralTransform…
2
votes
3 answers

Bug in K&R second edition?

Here's something that looks like a bug to me, however I am confused that my observation does not seem to pop up anywhere else on the internet, given the age and popularity of the book. Or maybe I am just bad at searching or it is not a bug at all. I…
timgeb
  • 76,762
  • 20
  • 123
  • 145
2
votes
1 answer

Map marker on Google Android Maps API v2 with set bounds

In APIv1 I was drawing markers like this: Drawable flag = getResources().getDrawable(R.drawable.flagfinish); flag.setBounds(0, -flag.getIntrinsicHeight(), flag.getIntrinsicWidth(), 0); and it was working - left bottom corner of picture was…
Tunerx
  • 619
  • 9
  • 21
2
votes
1 answer

View Controller's View's properties

I'm working on the interface for a specialized calculator and I have the following setup in IB: I used the "Container View" from IB and set it equal to my custom view controller, "ButtonViewController". Then, inside my ButtonViewController.m file,…
Darrell
  • 103
  • 1
  • 7
2
votes
3 answers

List out of bounds due to loop

im trying to make a function that looks through a list and deletes all odd numbers. I have a problem where my loop is going out of bounds and im not sure how to fix it, can anyone help? Thanks def isEven(number): if(number % 2) == 0 and (number…
h1h1
  • 730
  • 4
  • 11
  • 19
2
votes
1 answer

Why does a landscape view report it's center as if it were portrait?

I have a landscape only app. The views are designed in IB as landscape (568x320). Yet when I do this: NSLog(@"view center: %@", NSStringFromCGPoint(self.view.center)); I get this: view center: {160, 284} Which is what the center would be in…
soleil
  • 12,133
  • 33
  • 112
  • 183
2
votes
2 answers

Pane not resizing to its transformed dimensions

I am working on a project where i want to display images with overlay. My Idea was to create an AncorPane, put an ImageView in its background and then put several shapes above that. This does work. Because the images are quite large they need to be…
l2p
  • 420
  • 3
  • 9
2
votes
3 answers

datastructure that holds closures, parametrically in scala

I am implementing a GUI event system in Scala. I have something like: case class EventObject case class KeyEventObject extends EventObject case class MouseEventObject extends EventObject I would like to store event listener closures in a…
2
votes
2 answers

AS3 MovieClip getRealBounds

As you well know in as3 we have a getBounds() method which returns the exact dimension and coordinates of the movieclip in the DisplayObject container we want. Fact is that these data are calculated based on the graphics in their state in the MC at…
Andrea Silvestri
  • 1,082
  • 4
  • 14
  • 41
2
votes
1 answer

Incorrect UIView bounds/drawing in the Simulator

I've created a single-view test app and added a UIButton and UIView to the UIViewController in the main storyboard. I have resized both the button an view to have the same size. In my VC's -viewDidAppear:animated method I dump the frame and bounds…
RobertJoseph
  • 7,968
  • 12
  • 68
  • 113
2
votes
3 answers

Is there a way to set bounds on a variable in Java?

For instance can I have a variable int x; and tell the compiler x can never be greater than 20 or less than -20 without having to write a method to check the value every iteration through the loop? (I should mention here this is for a vector-based…
Ty_
  • 828
  • 1
  • 11
  • 21
2
votes
1 answer

compute bounds of a path crash

I have closed Path-s, which consist of many Bezier segments. These Bezier segments have integer coordinates up to 5000,5000. I need to compute if a point is inside one of these closed Paths. I use this code: // p is a Path, bounds is a…
shelll
  • 3,234
  • 3
  • 33
  • 67
2
votes
1 answer

Bounds and Frame size in viewDidLoad

I push a view controller (mainVC) and add some subviews to it. Most of these views are built on-demand, as the user takes some action. When I build each view, I refer to mainVC.view.bounds to size the view. The ones that are built on demand size…
Ben Packard
  • 26,102
  • 25
  • 102
  • 183
2
votes
1 answer

How to specify bound for a generic type with generic type in Scala?

This question is about working with generic types and setting the bound, so please do not freak out because of the library I use. Treat it as an example. I work with Scalala and use such types DenseMatrix[V], DenseVectorCol[V] and DenseVectorRow[V].…
greenoldman
  • 16,895
  • 26
  • 119
  • 185