Questions tagged [overlap]

Two or more elements overlap when they partially or totally cover one another.

Two or more elements overlap when they partially or totally cover one another.
The way to find if the elements overlap or not is to test if one elements begins before the second one ends, while the second one begins before the first one ends.

For example, here are all of the ways two lines can overlap:

1.
s1|--------|e1
s2|--------|e2


2.
s1|-------|e1
     s2|--------|e2


3.
     s1|--------|e1
s2|--------|e2


4.
s1|-------------------|e1
     s2|--------|e2


5.
     s1|--------|e1
s2|-------------------|e2

Note that s1 is always smaller than e2, while s2 is always smaller than e1.

This is not the case when the two lines do not overlap:

1.
s1|--------|e1
                 s2|--------|e2


2.
                 s1|--------|e1
s2|--------|e2

Note that either s1 is bigger then e2 or s2 is bigger then e1.

The actual data type of the elements is completely irrelevant as long as it's comparable.

Therefore, to check if two elements overlap each other, all you need to do is this: (pseudo code)

If a.Start < b.End AND b.Start < a.End Then
    Overlap
Else
    No overlap
1905 questions
7
votes
5 answers

TableViewCell overlaps text

I'm having a problem with my TableViewCell I have two type of cell in my storyboard. when i scroll, the text overlaps in some cells. I Try everything but I do not know how else to do. thank you very much for the help public func tableView(tableView:…
Carolina
  • 437
  • 3
  • 18
7
votes
2 answers

CSS - Color divs intersection

I was wondering if a solution exists in pure CSS to color the intersection between two divs. For exemple, if I have two divs, with the same class like this:
They are placed on the…
Lord Grosse Jeanine
  • 1,111
  • 10
  • 29
7
votes
1 answer

Prevent node overlap in force directed graph

I have build a force directed graph for the social network analysis. The problem which I am facing is that nodes keeps on overlapping each other, How can I prevent overlapping of node in force directed graph ? Here is my code with dummy data And…
analyticalpicasso
  • 1,993
  • 8
  • 26
  • 45
7
votes
2 answers

Android : If markers are overlapping each other on the map, then the click event is fired for the last hidden one

In our application, a lot of markers are drawn in different locations and in certain cases at a certain zoom level, markers overlap each other. So when I click on the marker, I expect the top marker's onMarkerClick to be fired but instead it is…
Khalil
  • 360
  • 1
  • 4
  • 14
7
votes
3 answers

How to avoid transparency overlap using OpenGL?

I am working on a handwriting application on iOS. I found the sample project "GLPaint" from iOS documentation which is implemented by OpenGL ES, and I did something modification on it. I track the touch points and calculate the curves between the…
Joe Jia
  • 109
  • 1
  • 3
7
votes
1 answer

How to avoid the overlapping of text elements on the TreeMap when child elements are opened in D3.js?

I created a Tree in D3.js based on Mike Bostock's Node-link Tree. The problem I have and that I also see in Mike's Tree is that the text label overlap/underlap the circle nodes when there isn't enough space rather than extend the links to leave some…
alengel
  • 4,368
  • 3
  • 21
  • 28
6
votes
2 answers

Styling overlapping annotations in text with HTML tags and CSS

I want to annotate text with categories. Each categorie has a specific color. Also, I want to focus on the visualization of overlapping annotations. Annotations and Atoms The part of the text (user selection), which is annotated, I call atoms. For…
alexa
  • 63
  • 1
  • 4
6
votes
2 answers

Drop down menu hidden behind javascript slider

Currently my nav menu's drop down portion is being hidden behind the javascript slider I have directly below it. See the problem here. How can I have the drop down menu display over the slider? Here is some of the CSS for the two divs that contain…
Nick
  • 9,285
  • 33
  • 104
  • 147
6
votes
2 answers

android - overlap images (playing cards)

I am trying to make the playing cards in my game overlap such that only the first half of a card is seen and the other half is covered by the next playing card. The only card that should be completely visible will be the last/rightmost card. I have…
6
votes
3 answers

Where do two 2-D arrays begin to overlap each other?

I'm working with model output at the moment, and I can't seem to come up with a nice way of combining two arrays of data. Arrays A and B store different data, and the entries in each correspond to some spatial (x,y) point -- A holds some parameter,…
6
votes
2 answers

Prevent date overlap postgresql

Is there a way to add a constraint to a postgresql table to prevent dates overlapping? For example, I have a table called workouts that has date columns week_start, week_end. I want to make sure that none of the week_start - week_end ranges overlaps…
Trung Tran
  • 13,141
  • 42
  • 113
  • 200
6
votes
2 answers

Android layout: place a view between two views

I am trying to make a screen, preferably with XML only, to look like this: I followed this approach, but using FrameLayout I only have the option to position the "orange" view using layout_gravity, and as I try to explain in the image, I don't know…
RominaV
  • 3,335
  • 1
  • 29
  • 59
6
votes
2 answers

Count max. number of concurrent user sessions per day

Situation We have a PostgreSQL 8.4 database containing user sessions with login date/time and logout date/time per row. Our web application records this time and also handles the case when user does not logout explicitly (session timeout). So a…
6
votes
4 answers

HTML, CSS: overbar matching square root symbol

Is there a way in HTML4 and/or CSS to do the following, but then correctly: √¯¯¯¯¯¯φ·(2π−γ)     ↑ ← ←  ← How can I move my expression to the left, under the ¯ symbols, such that they overlap eachother? Note: it should work on every…
Pindatjuh
  • 10,550
  • 1
  • 41
  • 68
6
votes
3 answers

JAVA & Joda Time API: compare intervals, detect overlapping and generate new intervals

I am working on a project that confuses me really bad right now. Given is a List list that contains elements of the class TimeInterval, which looks like this: public class TimeInterval { private static final Instant CONSTANT = new…
Mosh Pit
  • 318
  • 5
  • 14