本文整理汇总了C++中LayerImage::isEditable方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerImage::isEditable方法的具体用法?C++ LayerImage::isEditable怎么用?C++ LayerImage::isEditable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerImage
的用法示例。
在下文中一共展示了LayerImage::isEditable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onExecute
void UnlinkCelCommand::onExecute(Context* context)
{
ContextWriter writer(context);
Document* document(writer.document());
bool nonEditableLayers = false;
{
Transaction transaction(writer.context(), "Unlink Cel");
// TODO the range of selected frames should be in doc::Site.
auto range = App::instance()->timeline()->range();
if (range.enabled()) {
Sprite* sprite = writer.sprite();
for (LayerIndex layerIdx = range.layerBegin(); layerIdx <= range.layerEnd(); ++layerIdx) {
Layer* layer = sprite->indexToLayer(layerIdx);
if (!layer->isImage())
continue;
LayerImage* layerImage = static_cast<LayerImage*>(layer);
for (frame_t frame = range.frameEnd(),
begin = range.frameBegin()-1;
frame != begin;
--frame) {
Cel* cel = layerImage->cel(frame);
if (cel && cel->links()) {
if (layerImage->isEditable())
transaction.execute(new cmd::UnlinkCel(cel));
else
nonEditableLayers = true;
}
}
}
}
else {
Cel* cel = writer.cel();
if (cel && cel->links()) {
if (cel->layer()->isEditable())
transaction.execute(new cmd::UnlinkCel(writer.cel()));
else
nonEditableLayers = true;
}
}
transaction.commit();
}
if (nonEditableLayers)
StatusBar::instance()->showTip(1000,
"There are locked layers");
update_screen_for_document(document);
}