-
Notifications
You must be signed in to change notification settings - Fork 68
-
Hi @hm21. I saw default config: |
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment · 17 replies
-
The configs you mention are inside |
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
-
Watching the video you can see that for brief moments you can glimpse pieces of the drawing that you shouldn't see Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-08-26.at.12.15.37.mp4 |
Beta Was this translation helpful? Give feedback.
All reactions
-
Do you have a solution to avoid to show pieces of the drawing outside image? |
Beta Was this translation helpful? Give feedback.
All reactions
-
The problem here is that every layer uses the Widget _bottomNavigationBar(
ProImageEditorState editor,
Key key,
BoxConstraints constraints,
) {
return Scrollbar(
/// Key is important for correct layer calculations
key: key,
controller: _bottomBarScrollCtrl,
scrollbarOrientation: ScrollbarOrientation.top,
thickness: isDesktop ? null : 0,
child: BottomAppBar(
height: kBottomNavigationBarHeight,
color: Colors.black,
padding: EdgeInsets.zero,
child: Center(
child: SingleChildScrollView(
controller: _bottomBarScrollCtrl,
scrollDirection: Axis.horizontal,
child: ConstrainedBox(
constraints: BoxConstraints(
minWidth: min(constraints.maxWidth, 500),
maxWidth: 500,
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
FlatIconTextButton(
label: Text('Paint', style: _bottomTextStyle),
icon: const Icon(
Icons.edit_rounded,
size: 22.0,
color: Colors.white,
),
onPressed: () async {
List<PaintingLayerData>? paintingLayers =
await editor.openPage<List<PaintingLayerData>>(
PaintingEditor.autoSource(
key: editor.paintingEditor,
file: editor.editorImage.file,
byteArray: editor.editorImage.byteArray,
assetPath: editor.editorImage.assetPath,
networkUrl: editor.editorImage.networkUrl,
initConfigs: PaintEditorInitConfigs(
configs: editor.configs,
callbacks: editor.callbacks,
layers: editor.activeLayers,
theme: editor.configs.theme ?? ThemeData.dark(),
mainImageSize:
editor.sizesManager.decodedImageSize,
mainBodySize: editor.sizesManager.bodySize,
transformConfigs:
editor.stateManager.transformConfigs,
appliedBlurFactor: editor.stateManager.activeBlur,
appliedFilters: editor.stateManager.activeFilters,
),
),
duration: const Duration(milliseconds: 0),
);
if (paintingLayers != null &&
paintingLayers.isNotEmpty) {
for (var i = 0; i < paintingLayers.length; i++) {
editor.addLayer(
paintingLayers[i],
blockSelectLayer: true,
blockCaptureScreenshot:
i != paintingLayers.length - 1,
);
}
setState(() {});
editor.mainEditorCallbacks?.handleUpdateUI();
}
},
),
FlatIconTextButton(
label: Text('Text', style: _bottomTextStyle),
icon: const Icon(
Icons.text_fields,
size: 22.0,
color: Colors.white,
),
onPressed: editor.openTextEditor,
),
FlatIconTextButton(
label: Text('Crop/ Rotate', style: _bottomTextStyle),
icon: const Icon(
Icons.crop_rotate_rounded,
size: 22.0,
color: Colors.white,
),
onPressed: editor.openCropRotateEditor,
),
FlatIconTextButton(
label: Text('Filter', style: _bottomTextStyle),
icon: const Icon(
Icons.filter,
size: 22.0,
color: Colors.white,
),
onPressed: editor.openFilterEditor,
),
FlatIconTextButton(
label: Text('Emoji', style: _bottomTextStyle),
icon: const Icon(
Icons.sentiment_satisfied_alt_rounded,
size: 22.0,
color: Colors.white,
),
onPressed: editor.openEmojiEditor,
),
],
),
),
),
),
),
),
);
}
|
Beta Was this translation helpful? Give feedback.
All reactions
-
if I used onUpdateUI in CropRotateEditorCallbacks how do I get the image size?
|
Beta Was this translation helpful? Give feedback.
All reactions
-
Even after the onDOne callback I can't find any variable that gives me the correct size of the image at that moment to calculate the new size to pass to _buildImageBoundary |
Beta Was this translation helpful? Give feedback.
The configs you mention are inside
ImageGeneratioConfigs
which, as the name says, is only for image generation.Currently, there are no other configs that allow this. However, you can also work with
customWidgets
, where for example, you put a container outside the image areas and useIgnorePointer
orAbsorbPointer
so that the user can't draw there.