Skip to content
Snippets Groups Projects
Unverified Commit 4b10ec3d authored by Paul Kaplan's avatar Paul Kaplan Committed by GitHub
Browse files

Merge pull request #2102 from paulkaplan/monitor-flicker

Fix several minor monitor issues from recent testing
parents 6dfc10e9 200332be
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,12 @@ import styles from './monitor-list.css'; ...@@ -10,7 +10,12 @@ import styles from './monitor-list.css';
const stageSizeToTransform = ({width, height, widthDefault, heightDefault}) => { const stageSizeToTransform = ({width, height, widthDefault, heightDefault}) => {
const scaleX = width / widthDefault; const scaleX = width / widthDefault;
const scaleY = height / heightDefault; const scaleY = height / heightDefault;
return `scale(${scaleX},${scaleY})`; if (scaleX === 1 && scaleY === 1) {
// Do not set a transform if the scale is 1 because
// it messes up `position: fixed` elements like the context menu.
return;
}
return {transform: `scale(${scaleX},${scaleY})`};
}; };
const MonitorList = props => ( const MonitorList = props => (
...@@ -24,9 +29,7 @@ const MonitorList = props => ( ...@@ -24,9 +29,7 @@ const MonitorList = props => (
> >
<Box <Box
className={styles.monitorListScaler} className={styles.monitorListScaler}
style={{ style={stageSizeToTransform(props.stageSize)}
transform: stageSizeToTransform(props.stageSize)
}}
> >
{props.monitors.valueSeq().filter(m => m.visible) {props.monitors.valueSeq().filter(m => m.visible)
.map(monitorData => ( .map(monitorData => (
......
...@@ -60,6 +60,11 @@ ...@@ -60,6 +60,11 @@
flex-direction: row; flex-direction: row;
} }
.slider {
width: 100%;
transform: translateZ(0); /* Fixes flickering in Safari */
}
.list-monitor { .list-monitor {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -81,7 +86,6 @@ ...@@ -81,7 +86,6 @@
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: scroll;
overflow-x: hidden; overflow-x: hidden;
height: calc(100% - 44px); height: calc(100% - 44px);
} }
...@@ -150,12 +154,13 @@ ...@@ -150,12 +154,13 @@
outline: none; outline: none;
font-size: 0.75rem; font-size: 0.75rem;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
width: 100%;
} }
.remove-button { .remove-button {
position: absolute; position: absolute;
top: 4px; top: 4px;
right: 3px; right: 6px;
cursor: pointer; cursor: pointer;
color: $ui-white; color: $ui-white;
} }
......
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import classNames from 'classnames';
import styles from './monitor.css'; import styles from './monitor.css';
const SliderMonitor = ({categoryColor, label, min, max, value, onSliderUpdate}) => ( const SliderMonitor = ({categoryColor, label, min, max, value, onSliderUpdate}) => (
...@@ -17,13 +19,12 @@ const SliderMonitor = ({categoryColor, label, min, max, value, onSliderUpdate}) ...@@ -17,13 +19,12 @@ const SliderMonitor = ({categoryColor, label, min, max, value, onSliderUpdate})
</div> </div>
<div className={styles.row}> <div className={styles.row}>
<input <input
className="no-drag" // Class used on parent Draggable to prevent drags className={classNames(styles.slider, 'no-drag')} // Class used on parent Draggable to prevent drags
max={max} max={max}
min={min} min={min}
type="range" type="range"
value={value} value={value}
onChange={onSliderUpdate} onChange={onSliderUpdate}
// @todo onChange callback
/> />
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment