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

two divs overlap, how to fix?

Apparently, I have got two divs on the same line overlap, it's appearing ok on PC but not on Ipad or mobile, anyone could look through the code and tell me what I have missed? It's the content overlaping over the youtube video. Code: .timeline…
nsic
  • 153
  • 4
  • 15
0
votes
3 answers

Decrease gap between two blocks of text without overlapping the background color

I wonder if anyone can help. I'm trying to get 2 blocks of copy which will be acting as a title and a short description to sit under each other. They both have background colours set to them, however, when I try to move the lower paragraph section…
NickL
  • 3
  • 1
0
votes
1 answer

Two dates range overlap - 1501 people missing bug? [PHP]

https://stackoverflow.com/questions/325933/determine-whether-two-date-ranges-overlap I wrote this post to be sure am I wrong or no one saw the bug here. To be sure I collect all the data in functions to show results and describe my point. All was…
Lesenus
  • 51
  • 1
  • 4
0
votes
0 answers

Combine simple plots of different length into same plot

So I'm going to start from the very beginning so sorry if it gets a little lengthy. My runnable code for you all is... structure(list(X1 = 0:29, seasoncode = c("E2015", "E2015", "E2015", "E2015", "E2015", "E2015", "E2015", "E2015", "E2015",…
Steven
  • 1
  • 1
0
votes
2 answers

Making sure the ships do not overlap

I have been stuck on this task for a long time now, so I thought it was about time to ask for some help. I am making a game of battle ship and I am currently writing a function where the ships are randomly placed on the 10 x 10 grid. I have this…
sarah campolt
  • 148
  • 2
  • 13
0
votes
2 answers

Loop through leaflet FeatureGroup

I have a map with 3 geoJson layers representing school district boundaries. The functionality I need is simple: click the map, get a popup with the school names for each level (elementary, middle, and high school.) [eLayer,mLayer,hLayer] Here's my…
Doug Kampe
  • 3
  • 1
  • 3
0
votes
3 answers

Postgres - detect overlapping lines from 2 tables

QUESTION: I have 2 tables with bike and hike trails of a country (Poland). Table bicycle_merge way | route | name |network |osmc_color| state geometry | text | text |text |text |…
Voyteck
  • 81
  • 2
  • 12
0
votes
2 answers

How to make nested Div wrap instead of overlap?

I'm using Bootstrap's grid system. I have 3 divs inside a "row", and inside each of those divs are nested controls. When I horizontally decrease the browser size, the 2nd and 3rd div in the row are overlapping the 1st div. I want them to wrap, not…
markoos
  • 125
  • 1
  • 7
0
votes
0 answers

drag and drop android overlapping images

I am working on this project where the user can customize their own pizza. How this works is the user can drag a topping to the plain pizza dough and once the topping has been dropped, the picture of the topping will then be displayed above the…
0
votes
0 answers

Non-overlapping wordcloud in R

I am trying to create a word cloud in R, but it is hard to read because all of the words overlap one another. Below is an example of my problem. df <-…
Lily
  • 1
0
votes
0 answers

Python Regex take overlapping tags into account when finding matches

Regex always seems to be a tough topic when I'm exercising myself with Python. I got stuck when trying to extract all text between two tags. I came up with this piece of code: m=re.compile('
(.*?)
',…
J. Williams
  • 135
  • 3
  • 10
0
votes
2 answers

Different paths on the same route with overlapping

I have a jorney between A and B which has different paths to end it. The paths are defined by the initial and final kilometers: path 0 -> (0, 10) path 1 -> (10, 25) path 2 -> (10, 15) path 3 -> (15, 20) path 4 -> (20, 30) path 5 -> (25, 35) path 6…
RobinHood
  • 377
  • 4
  • 20
0
votes
1 answer

Make a graph with cytoscape without overlaps

I use cytoscape to display a graph whose nodes can overlap. I would like to avoid this but without changing the position y of each node. I use the position y of a node to manage levels but the position x can vary without problem. …
0
votes
1 answer

Scaling a sphere creates overlapping collisions

I have a pawn/actor that is a sphere (a snowball). When I roll on snow, it grows (I scale it and add mass). Problem: I have a weird behavior, my ball rolls but sometimes "jumps" (or bounce up). The reason seems to be that the ball become bigger and…
David Gourde
  • 3,709
  • 2
  • 31
  • 65
0
votes
1 answer

R: Find all overlaps in data frame

I have a dataframe (sample below) that has repeating data. The first column is the data from which the sample data was taken. I would like to create a table that calculates the number of overlaps in each possible intersection between the dates. In…
Z_D
  • 797
  • 2
  • 12
  • 30