Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解决不能双击问题和页面不能显示滚动条问题 #226

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"icon": "resources/icon_128.png",
"author": {
"email": "[email protected]",
"name": "Kenneth Auchenberg"
"name": "auchenberg"
},
"description": "This extension is deprecated in favor of the Live Preview extension.",
"publisher": "auchenberg",
Expand All @@ -19,7 +19,7 @@
"workspace"
],
"license": "MIT",
"version": "0.7.2",
"version": "0.7.3",
"main": "./build/ext-src/extension.js",
"activationEvents": [
"onView:targetTree",
Expand Down
Binary file added resources/live_debug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion src/components/screencast/screencast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ class Screencast extends React.Component<any, any> {

public render() {
let canvasStyle = {
cursor: this.viewportMetadata ? this.viewportMetadata.cursor : 'auto'
cursor: this.viewportMetadata ? this.viewportMetadata.cursor : 'auto',
display: this.state.display
};

return (
Expand All @@ -84,6 +85,7 @@ class Screencast extends React.Component<any, any> {
onMouseUp={this.handleMouseEvent}
onMouseMove={this.handleMouseEvent}
onClick={this.handleMouseEvent}
onDoubleClick={this.handleMouseEvent}
onWheel={this.handleMouseEvent}
onKeyDown={this.handleKeyEvent}
onKeyUp={this.handleKeyEvent}
Expand Down Expand Up @@ -121,6 +123,12 @@ class Screencast extends React.Component<any, any> {
canvasElement.width = canvasWidth * devicePixelRatio;
canvasElement.height = canvasHeight * devicePixelRatio;
this.canvasContext.scale(devicePixelRatio, devicePixelRatio);
//判断canvasHeight和canvasElement.height的大小
if (canvasHeight > canvasElement.height) {
this.setState({ display: 'inline' });
} else {
this.setState({ display: 'block' });
}

// Render checkerboard
this.canvasContext.save();
Expand Down Expand Up @@ -252,6 +260,11 @@ class Screencast extends React.Component<any, any> {
this.props.onInspectElement({
position: position
});
} else if (event.type === 'dblclick') {
const position = this.convertIntoScreenSpace(event, this.state);
this.props.onInspectElement({
position: position
});
} else if (event.type === 'mousemove') {
const position = this.convertIntoScreenSpace(event, this.state);
this.props.onInspectHighlightRequested({
Expand Down