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

d3 word clouds - too much overlaps occurring

i am using the d3 example from http://www.jasondavies.com/wordcloud/#http%3A%2F%2Fen.wikipedia.org%2Fwiki%2F%7Bword%7D=cloud to build my own word cloud. All i am trying to do is to get some colour attribute added to the words based on property of…
5
votes
6 answers

How to control `div` overlapping in html

I am creating a webpage, And I have two divs, A and B for instance. A's position is fixed and it's on top of the page, but B's position is absolute and is somewhere in the middle of the page. When they Overlap, B comes on top of A, But I want this…
Makan
  • 2,508
  • 4
  • 24
  • 39
5
votes
1 answer

WPF expander style where the header overlaps content

I would like a WPF expander control where the header overlaps the main content area. With the following XAML
nuro
  • 248
  • 3
  • 11
5
votes
4 answers

OpenGL transparent images have black in them

I am working on a game for Android and I was wondering why whenever I draw images with transparency there seems to always be some black added to the transparent parts. This happens all over and makes some of my effects look strange. Here is an…
Alchitry
  • 1,369
  • 1
  • 16
  • 29
4
votes
3 answers

Android - LazyAdapter overlapping views

I am doing lazyloading to display images and text. I have got everything up and now, trying to add a textview in the view. However, my adapter is overlapping my view. Simpler terms is that, the listview is overlapping the textview. I'm not sure…
Hend
  • 589
  • 5
  • 15
  • 35
4
votes
2 answers

Position relative overlaps float-left

For a back-end solution of a CMS exclusively, I wanted to enable the user to switch any CMS element to float: left on purpose. However, I had to find that as all my container elements also use relative positioning, any element that is placed next to…
SquareCat
  • 5,699
  • 9
  • 41
  • 75
4
votes
1 answer

Check for and combine overlapping ranges

How can I check if ranges overlap other ranges and combine the ones that do? Example: 10-1000,15-350,50-1500,2100,1700-1800,45,40,145,2-1300 The result I want is: 2-1500,1700-1800,2100 I tried to make a plan on how to code it but it's getting me…
tomooboy
  • 43
  • 2
4
votes
1 answer

Disable swipe gesture in child component in Android Jetpack Compose

As mentioned by the title, I want to disable the swipe gestures ExposedDropdownMenuBox in a Composable. The reason is sometimes, the swipe triggers both Drawer's swipe to open and the ExposedDropdownMenuBox. Specifically, when you swipe on the…
T D Nguyen
  • 7,054
  • 4
  • 51
  • 71
4
votes
0 answers

Calculate the percentage of Overlap between Convex Hull (ggplot

I want to know if it is possible to know the percentage of overlap between convex hulls? For example, what is the % overlap between species Versicolor and Virginica? The code I used for the plot: library(ggplot2) library(plyr) iris find_hull <-…
Bonnie
  • 61
  • 2
4
votes
1 answer

Image over div-container

How can I overlap the message strip with the div? The position of the div "nav" must be fixed.
shub
  • 1,062
  • 6
  • 21
  • 39
4
votes
2 answers

How to fix axis title overlapped with axis labels in barplot?

I have generated a bar plot/histogram for my data which shows the number of transactions for pack size. However, labels on x axis for the bars are out of the margin. The plot is presented below. I have tried to fix this by setting the outer margin…
newt335
  • 175
  • 1
  • 1
  • 9
4
votes
1 answer

Merge overlapping datetime intervals

I have a df with multiple datetime intervals (start time, end time) and values. input: id start end value 1 08:00:00.000 12:00:00.000 5 2 09:00:00.000 10:00:00.000 6 2 10:00:00.000 14:00:00.000 4 1 …
NCall
  • 113
  • 6
4
votes
5 answers

Javascript simultaneous object and array creation

Why does javascript allow me to do the following. a = {two : 'World'}; a[1] = 'Hello'; console.log(a[1]); console.log(a.two); the output is Hello World Shouldn't it complain that I am trying to use an object as an Array? This works with anything…
puk
  • 16,318
  • 29
  • 119
  • 199
4
votes
1 answer

Matplotlib - Python- GetDist tool - Overlapping 2 triangle plots (triplots) by calling twice the plot function: issue of visible priority between both

In python3, I am faced to 2 issues using the tool GetDist tool to produce triplot of covariance matrix. 1) Currently, I can plot 2 covariance matrixes on the same figure by only one call of the plotting function (triangle_plot). Specifying as first…
user1773603
4
votes
1 answer

React: check if elements in different components overlap

I am looking at many answers of checking if elements overlap, but they are not applicable. I have a wrapper component that has a header with position fixed and children const Wrapper = ({ children }) => { return ( <>
user3808307
  • 2,270
  • 9
  • 45
  • 99