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

Remove overlapped Circles in MATLAB

I have written a MATLAB code to be able to visualize some Circles. Please have a look at my below code and the attached figure as the output. clc; clear; close all; % X and Y of each Center Xloc =…
0
votes
5 answers

css for a div overlaps divs which are floating?

I am pretty much a beginner and I am trying to find out why doesn't my css work properly. The problem is that I set the background color to be green for a div with the id #zona6, but the color applies over the divs with the ids #zona2 and #zona3.…
0
votes
1 answer

Check overlapping at offset - Phaser

I'm trying to write a function that checks arcade physics bodies overlapping at a certain offset. Here's my code: function overlapAtOffsetSprite(object1, object2, offsetX, offsetY) { if (typeof(object1.body) === "undefined" ||…
Moaz Ashraf
  • 210
  • 1
  • 3
  • 11
0
votes
1 answer

Floats overlaping text overlaps image

on the picture u can see my problem of the text overlapping my image when the screen is less then 1400 pixels wide or so. This is my HTML of it.
StijnT
  • 3
  • 2
0
votes
0 answers

Android: Skipped frame when drag imageview that overlap another

I am developing Photo Frame application. I got an issue in this case: If I have only one imageview, I can drag, rotate, zoom. But when I insert second imageview overlap first imageview, then I drag imageview1 again, it is very lag with logcat: The…
kidsoul
  • 69
  • 1
  • 10
0
votes
2 answers

Overlapping text on mobile website

I believe this is just a css issue. So I'll only show that code. body { margin: 0px; padding: 0; font-family: 'Raleway', sans-serif; color: white; background-image: url('https://m.mywebsite.com/style/mobile.jpg'); background-size:…
swxft
  • 29
  • 1
  • 10
0
votes
1 answer

ID Overlap checking algorithm

Example, the server has these ids: aaaa, aaaa - 1 , aaaa - 2 , bbbb If the client sign in, the server check client's algorithm If the client's id is aaaa, server make client's id aaaa - 3 If the client's id is bbbb, server make client's id bbbb…
0
votes
1 answer

c# uwp cut of usercontrol

I have created a usercontrol that has some controls outside of view, but they will be visible as soon as animation show them. Animation is changing their offset, so they slowly appears. Now, when I put my usercontrol on some view, those controls…
user3239349
  • 877
  • 1
  • 12
  • 33
0
votes
1 answer

PHP create booking info from an array with different priorities and times ranges per date which ain't allowed to overlap

I have the following PHP array: Array ( [20170118] => Array ( [1420] => Array ( [ENDDATE] => 2017-01-18 [STARTTIME] => 1420 [ENDTIME] => 1530 [PRIORITY] =>…
0
votes
2 answers

What's the most efficient way to find which lists of strings are similar if you have n lists?

Say I have 10 unordered lists of 100 string elements in each. What's the fastest way to find which lists have a high degree of overlap (e.g. 50%+) with another list or lists, and which list(s) they overlap with? What would if we scaled it up to…
0
votes
2 answers

Bootstrap 4 navbar overlapping on mobile

I am making a project at school and I am using Bootstrap 4 and I am pretty new to it. I have my navbar brand as an image centered in the middle of the navbar. But when I switch over to a smaller screen some of the navbar items get moved down under…
AskGoogle
  • 13
  • 6
0
votes
1 answer

Responsive Slides - overlaps another div when resized

Url - http://www.eden-lime-mortar.co.uk/index18.html As the screen size is reduced (about the point it becomes a tablet potrait view) the responsive slide images overlap the div with the spry menu. Using dreamweaver fluid grid and…
0
votes
0 answers

Overlap of DNA in Python programming

The output should be the similarity length, in this case 15(length) Can anyone helps me?
Ok alj
  • 11
  • 3
0
votes
1 answer

Algorithm: How to re-arrange a time-range event (interval) list based on wether time events overlap, faster than O(n^2)?

Let's say I have an array of time ranges like so: [ { name: 'A', startTime: '10:15', endTime: '11:15'}, { name: 'B', startTime: '10:45', endTime: '14:15'}, { name: 'C', startTime: '15:35', endTime: '16:15'}, { name: 'D', startTime: '11:30',…
SudoPlz
  • 20,996
  • 12
  • 82
  • 123
0
votes
1 answer

Masonry only on page return, layout overlapping

I'm currently having a weird bug. It only happens on Internet Explorer and Microsoft Edge. On the first page load, the layout looks good, as it needs to be. Once you go to a different page, and after you decide to return to the previous page where…
Tudor
  • 3
  • 2