Solve bug where small gaps where showing in temp line
This commit is contained in:
@@ -119,8 +119,9 @@ export default class DayColumn extends Component {
|
|||||||
const heightDiff = -leftY - -rightY
|
const heightDiff = -leftY - -rightY
|
||||||
const angle = Math.atan2(heightDiff, colWidth / 2)
|
const angle = Math.atan2(heightDiff, colWidth / 2)
|
||||||
const lineStyle = excludeLine ? styles.curveExcluded : styles.curve
|
const lineStyle = excludeLine ? styles.curveExcluded : styles.curve
|
||||||
// hypotenuse
|
// hypotenuse, we add 3px for good measure, because otherwise the lines
|
||||||
const h = (colWidth / 2) / Math.cos(angle)
|
// don't quite touch at the day border
|
||||||
|
const h = (colWidth / 2) / Math.cos(angle) + 3
|
||||||
// the rotation by default rotates from the middle of the line,
|
// the rotation by default rotates from the middle of the line,
|
||||||
// but we want the transform origin to be at its beginning
|
// but we want the transform origin to be at its beginning
|
||||||
// react native doesn't have transformOrigin, so we do this manually
|
// react native doesn't have transformOrigin, so we do this manually
|
||||||
@@ -132,7 +133,7 @@ export default class DayColumn extends Component {
|
|||||||
return (<View
|
return (<View
|
||||||
width={h}
|
width={h}
|
||||||
position = 'absolute'
|
position = 'absolute'
|
||||||
top={(leftY + rightY) / 2}
|
top={((leftY + rightY) / 2) - lineStyle.borderWidth / 2}
|
||||||
left={projectedX}
|
left={projectedX}
|
||||||
style={{
|
style={{
|
||||||
transform: [
|
transform: [
|
||||||
|
|||||||
Reference in New Issue
Block a user