remove dead code/dead comments
parent
a0363d6945
commit
f702075e3d
99
helper.js
99
helper.js
|
|
@ -107,101 +107,4 @@ async function unSelect() {
|
|||
return result
|
||||
}
|
||||
|
||||
// async function layerToSelectionHelper () {
|
||||
// // console.log("executeAsModal layer.translate")
|
||||
|
||||
// //get selection info
|
||||
// let activeLayer = getActiveLayer()
|
||||
// let selectionInfoPromise = await getSelectionInfo()
|
||||
// selectionInfoPromise.then(async value => {
|
||||
// console.dir(value)
|
||||
|
||||
// let selection = value[0].selection
|
||||
|
||||
// // let selectionInfo = value[0].selection
|
||||
|
||||
// //unselect everything so you can move the layer
|
||||
// // top_new = layer_info.top - top_dist
|
||||
// executeAsModal(unSelect).then(() => {
|
||||
// console.log('done unSelect Exe')
|
||||
// //scale layer
|
||||
// async function scaleLayer (executionContext) {
|
||||
// console.log('scaleLayer got called')
|
||||
// let layer_info = getLayerSize(activeLayer)
|
||||
// scale_x_ratio = (selection_info.width / layer_info.width) * 100
|
||||
// scale_y_ratio = (selection_info.height / layer_info.height) * 100
|
||||
// console.log('scale_x_y_ratio:', scale_x_ratio, scale_y_ratio)
|
||||
// activeLayer.scale(scale_x_ratio, scale_y_ratio)
|
||||
// }
|
||||
|
||||
// executeAsModal(scaleLayer).then(async () => {
|
||||
// console.log('done scaling Exe')
|
||||
|
||||
// await require('photoshop').core.executeAsModal(moveLayerExe)
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
|
||||
// async function layerToSelection (selection_info) {
|
||||
// //store active layer for later
|
||||
|
||||
// const { executeAsModal } = require('photoshop').core
|
||||
|
||||
// try {
|
||||
// //Store selection info
|
||||
// //unSelect
|
||||
// //move layer
|
||||
// //scale layer
|
||||
// //Select from selection info
|
||||
// // let selection_info = await getSelectionInfo()
|
||||
|
||||
// console.log('selection_info:',selection_info)
|
||||
|
||||
// console.log('unSelect')
|
||||
|
||||
// await executeAsModal(unSelect, {'commandName': 'unSelect'})
|
||||
|
||||
// //scale layer
|
||||
// async function scaleLayer (executionContext) {
|
||||
// console.log('scaleLayer got called')
|
||||
// // const activeLayer = getActiveLayer()
|
||||
// const activeLayer = await app.activeDocument.activeLayers[0]
|
||||
|
||||
// let layer_info = getLayerSize(activeLayer)
|
||||
// scale_x_ratio = (selection_info.width / layer_info.width) * 100
|
||||
// scale_y_ratio = (selection_info.height / layer_info.height) * 100
|
||||
// console.log('scale_x_y_ratio:', scale_x_ratio, scale_y_ratio)
|
||||
// activeLayer.scale(scale_x_ratio, scale_y_ratio)
|
||||
// }
|
||||
// await executeAsModal(scaleLayer, {'commandName': 'scaleLayer'})
|
||||
|
||||
// async function moveLayerExe (layerToMove, selection_info) {
|
||||
|
||||
// let layer_info = getLayerSize(layerToMove)
|
||||
// top_dist = layer_info.top - selection_info.top
|
||||
// left_dist = layer_info.left - selection_info.left
|
||||
// await layerToMove.translate(-left_dist, -top_dist)
|
||||
// }
|
||||
// // const activeLayer = await getActiveLayer()
|
||||
// //store all active layers
|
||||
// const activeLayers = await app.activeDocument.activeLayers
|
||||
|
||||
// await executeAsModal(async () => {
|
||||
|
||||
// for (let layer of activeLayers){
|
||||
// await psapi.selectLayers([layer])
|
||||
// await moveLayerExe(layer, selection_info)
|
||||
// }
|
||||
// }, {'commandName': 'moveLayerExe'})
|
||||
|
||||
// await reselect(selection_info)
|
||||
// } catch (e) {
|
||||
// console.warn(e)
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
module.exports = {
|
||||
// layerToSelection
|
||||
}
|
||||
module.exports = {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue