Fix U2Net, alertify dialogs, and improve AI Paint workflow
- Switch U2Net from onnxruntime to OpenCV DNN to avoid "cannot enable executable stack" error in Docker - Add alertify dialog styling to fix white text on white background issue in popups - Add offerFloatSelection() to AI Paint that prompts user after selection to move/scale it (Canva-like workflow) - Auto-switch to Select tool after floating selection https://claude.ai/code/session_01CLedz6CanT9t46KBvng3vz
This commit is contained in:
@@ -262,7 +262,8 @@ class Brush_select_class extends Base_tools_class {
|
||||
if (isAdditive && this.currentMask) {
|
||||
alertify.success('Added to selection! Shift+brush to add more.');
|
||||
} else {
|
||||
alertify.success('Selection complete! Ctrl+C to copy, Ctrl+X to cut.');
|
||||
// Offer to float the selection for immediate manipulation (Canva-like)
|
||||
this.offerFloatSelection();
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
@@ -287,7 +288,8 @@ class Brush_select_class extends Base_tools_class {
|
||||
var maskCanvas = await this.decodeMask(result.mask);
|
||||
this.applyMaskCanvas(maskCanvas, false);
|
||||
|
||||
alertify.success('Selection complete! Brush over more to add.');
|
||||
// Offer to float the selection for immediate manipulation
|
||||
this.offerFloatSelection();
|
||||
|
||||
} catch (error) {
|
||||
console.error('Select error:', error);
|
||||
@@ -297,6 +299,34 @@ class Brush_select_class extends Base_tools_class {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Offer to float the selection to a new layer for manipulation (Canva-like workflow)
|
||||
*/
|
||||
offerFloatSelection() {
|
||||
var _this = this;
|
||||
|
||||
alertify.confirm(
|
||||
'Selection Complete',
|
||||
'Would you like to move/scale this selection? This will copy it to a new layer.',
|
||||
function() {
|
||||
// Yes - copy to layer and switch to Select tool
|
||||
_this.copyToLayer();
|
||||
|
||||
// Switch to Select tool
|
||||
setTimeout(function() {
|
||||
var selectTool = document.querySelector('.sidebar_left .item[data-tool="select"]');
|
||||
if (selectTool) {
|
||||
selectTool.click();
|
||||
}
|
||||
}, 100);
|
||||
},
|
||||
function() {
|
||||
// No - just keep the selection
|
||||
alertify.message('Tip: Use Ctrl+C to copy or Ctrl+X to cut the selection.');
|
||||
}
|
||||
).set('labels', {ok: 'Yes, Move/Scale', cancel: 'Keep Selection'});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sample key points from brush stroke for SAM
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user