{"action":"created","issue":{"url":"https://api.github.com/repos/abe33/atom-pigments/issues/44","repository_url":"https://api.github.com/repos/abe33/atom-pigments","labels_url":"https://api.github.com/repos/abe33/atom-pigments/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/abe33/atom-pigments/issues/44/comments","events_url":"https://api.github.com/repos/abe33/atom-pigments/issues/44/events","html_url":"https://github.com/abe33/atom-pigments/issues/44","id":91128973,"number":44,"title":"Uncaught TypeError: Cannot read property 'getBoundingClientRect' of null","user":{"login":"maxguzenski","id":6819,"avatar_url":"https://avatars.githubusercontent.com/u/6819?v=3","gravatar_id":"","url":"https://api.github.com/users/maxguzenski","html_url":"https://github.com/maxguzenski","followers_url":"https://api.github.com/users/maxguzenski/followers","following_url":"https://api.github.com/users/maxguzenski/following{/other_user}","gists_url":"https://api.github.com/users/maxguzenski/gists{/gist_id}","starred_url":"https://api.github.com/users/maxguzenski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxguzenski/subscriptions","organizations_url":"https://api.github.com/users/maxguzenski/orgs","repos_url":"https://api.github.com/users/maxguzenski/repos","events_url":"https://api.github.com/users/maxguzenski/events{/privacy}","received_events_url":"https://api.github.com/users/maxguzenski/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-06-26T02:21:51Z","updated_at":"2016-05-04T08:45:14Z","closed_at":"2015-06-27T16:24:04Z","body":"Steps to reproduce below:\r\n\r\n1. Just make a right click on any file\r\n\r\n**Atom Version**: 1.0.0\r\n**System**: Mac OS X 10.10.4\r\n**Thrown From**: [pigments](https://github.com/abe33/atom-pigments) package, v0.8.0\r\n\r\n\r\n### Stack Trace\r\n\r\nUncaught TypeError: Cannot read property 'getBoundingClientRect' of null\r\n\r\n```\r\nAt /Users/max/.atom/packages/pigments/lib/color-buffer.coffee:286\r\n\r\nTypeError: Cannot read property 'getBoundingClientRect' of null\r\n  at ColorBuffer.module.exports.ColorBuffer.pixelPositionForMouseEvent (/Users/max/.atom/packages/pigments/lib/color-buffer.coffee:286:65)\r\n  at ColorBuffer.module.exports.ColorBuffer.screenPositionForMouseEvent (/Users/max/.atom/packages/pigments/lib/color-buffer.coffee:279:22)\r\n  at ColorBuffer.module.exports.ColorBuffer.colorMarkerForMouseEvent (/Users/max/.atom/packages/pigments/lib/color-buffer.coffee:273:17)\r\n  at Object.module.exports.colorMarkerForMouseEvent (/Users/max/.atom/packages/pigments/lib/pigments.coffee:154:18)\r\n  at Object.module.exports.shouldDisplayContextMenu (/Users/max/.atom/packages/pigments/lib/pigments.coffee:149:5)\r\n  at Object.atom.contextMenu.add.atom-text-editor.shouldDisplay (/Users/max/.atom/packages/pigments/lib/pigments.coffee:132:36)\r\n  at ContextMenuManager.module.exports.ContextMenuManager.templateForEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/context-menu-manager.js:108:25)\r\n  at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/context-menu-manager.js:166:27)\r\n  at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:150:33)\r\n  at HTMLDocument.handler (/Applications/Atom.app/Contents/Resources/app.asar/src/space-pen-extensions.js:112:34)\r\n  at HTMLDocument.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/space-pen/vendor/jquery.js:4681:9)\r\n  at HTMLDocument.elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/space-pen/vendor/jquery.js:4359:46)\r\n\r\n```\r\n\r\n### Commands\r\n\r\n```\r\n     -4:05.1.0 core:backspace (input.hidden-input)\r\n     -3:51.2.0 fuzzy-finder:toggle-file-finder (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-monokai-syntax-for-one-dark.theme-one-dark-ui)\r\n     -3:46.1.0 editor:consolidate-selections (input.hidden-input)\r\n     -3:46.1.0 core:cancel (input.hidden-input)\r\n     -3:05.2.0 command-palette:toggle (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-monokai-syntax-for-one-dark.theme-one-dark-ui)\r\n  2x -3:02.9.0 core:move-down (input.hidden-input)\r\n     -3:02.5.0 core:confirm (input.hidden-input)\r\n     -3:02.5.0 pigments:show-palette (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-monokai-syntax-for-one-dark.theme-one-dark-ui)\r\n     -1:27.7.0 fuzzy-finder:toggle-file-finder (div.settings-view.pane-item)\r\n  3x -1:25.6.0 core:backspace (input.hidden-input)\r\n     -1:24.9.0 editor:consolidate-selections (input.hidden-input)\r\n     -1:24.9.0 core:cancel (input.hidden-input)\r\n     -1:24.4.0 command-palette:toggle (div.settings-view.pane-item)\r\n     -1:22.9.0 core:move-down (input.hidden-input)\r\n     -1:20.6.0 core:confirm (input.hidden-input)\r\n     -1:20.6.0 pigments:find-colors (div.settings-view.pane-item)\r\n```\r\n\r\n### Config\r\n\r\n```json\r\n{\r\n  \"core\": {\r\n    \"disabledPackages\": [\r\n      \"language-objective-c\",\r\n      \"language-php\",\r\n      \"language-perl\",\r\n      \"language-make\",\r\n      \"language-mustache\",\r\n      \"language-java\",\r\n      \"distraction-free-mode\",\r\n    ],\r\n    \"audioBeep\": false,\r\n    \"themes\": [\r\n      \"one-dark-ui\",\r\n      \"monokai-syntax-for-one-dark\"\r\n    ]\r\n  },\r\n  \"pigments\": {}\r\n}\r\n```\r\n\r\n### Installed Packages\r\n\r\n```coffee\r\n# User\r\nautocomplete-sass, v0.1.0\r\ncolor-picker, v2.0.7\r\nfile-icons, v1.5.8\r\nlanguage-rspec, v0.3.0\r\nmonokai-syntax-for-one-dark, v0.2.2\r\npigments, v0.8.0\r\nproject-manager, v1.15.10\r\nreact, v0.12.0\r\ntabs-to-spaces, v0.11.0\r\n\r\n# Dev\r\nNo dev packages\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/abe33/atom-pigments/issues/comments/216791322","html_url":"https://github.com/abe33/atom-pigments/issues/44#issuecomment-216791322","issue_url":"https://api.github.com/repos/abe33/atom-pigments/issues/44","id":216791322,"user":{"login":"quarterto","id":631757,"avatar_url":"https://avatars.githubusercontent.com/u/631757?v=3","gravatar_id":"","url":"https://api.github.com/users/quarterto","html_url":"https://github.com/quarterto","followers_url":"https://api.github.com/users/quarterto/followers","following_url":"https://api.github.com/users/quarterto/following{/other_user}","gists_url":"https://api.github.com/users/quarterto/gists{/gist_id}","starred_url":"https://api.github.com/users/quarterto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quarterto/subscriptions","organizations_url":"https://api.github.com/users/quarterto/orgs","repos_url":"https://api.github.com/users/quarterto/repos","events_url":"https://api.github.com/users/quarterto/events{/privacy}","received_events_url":"https://api.github.com/users/quarterto/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T08:45:14Z","updated_at":"2016-05-04T08:45:14Z","body":"I'm also seeing this error thrown on right click. I have Shadow DOM enabled, so I suspect it's a different cause. This is the stack trace: \r\n\r\n```\r\nTypeError: Cannot read property 'getBoundingClientRect' of null\r\n    at pigments-markers.ColorBufferElement.pixelPositionForMouseEvent (/Users/matthew.brennan/.atom/packages/pigments/lib/color-buffer-element.coffee:384:54)\r\n    at pigments-markers.ColorBufferElement.screenPositionForMouseEvent (/Users/matthew.brennan/.atom/packages/pigments/lib/color-buffer-element.coffee:368:22)\r\n    at pigments-markers.ColorBufferElement.colorMarkerForMouseEvent (/Users/matthew.brennan/.atom/packages/pigments/lib/color-buffer-element.coffee:362:17)\r\n    at Object.module.exports.colorMarkerForMouseEvent (/Users/matthew.brennan/.atom/packages/pigments/lib/pigments.coffee:223:25)\r\n    at Object.module.exports.shouldDisplayContextMenu (/Users/matthew.brennan/.atom/packages/pigments/lib/pigments.coffee:217:5)\r\n    at Object.atom.contextMenu.add.atom-text-editor.shouldDisplay (/Users/matthew.brennan/.atom/packages/pigments/lib/pigments.coffee:166:36)\r\n    at ContextMenuManager.module.exports.ContextMenuManager.cloneItemForEvent (/opt/homebrew-cask/Caskroom/atom/1.6.2/Atom.app/Contents/Resources/app.asar/src/context-menu-manager.js:110:19)\r\n    at ContextMenuManager.module.exports.ContextMenuManager.templateForEvent (/opt/homebrew-cask/Caskroom/atom/1.6.2/Atom.app/Contents/Resources/app.asar/src/context-menu-manager.js:89:33)\r\n    at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (/opt/homebrew-cask/Caskroom/atom/1.6.2/Atom.app/Contents/Resources/app.asar/src/context-menu-manager.js:168:27)\r\n    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentContextmenu (/opt/homebrew-cask/Caskroom/atom/1.6.2/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:250:47)\r\n    at HTMLDocument.<anonymous> (/opt/homebrew-cask/Caskroom/atom/1.6.2/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)\r\n```"}}