<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>459849</bug_id>
          
          <creation_ts>2022-09-30 09:30:18 +0000</creation_ts>
          <short_desc>Using &quot;Copy/Cut Selection to New Layer&quot; on the &quot;File Layer&quot; is not valid.</short_desc>
          <delta_ts>2024-06-12 19:19:09 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>Layer Stack</component>
          <version>5.1.1</version>
          <rep_platform>Compiled Sources</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>triaged</keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eranthis stellata Maxim">1012468643</reporter>
          <assigned_to name="Krita Bugs">krita-bugs-null</assigned_to>
          <cc>griffinvalley</cc>
          
          <cf_commitlink>https://invent.kde.org/graphics/krita/-/commit/eb29ed416fa3dc6f49b5d65996570e39e5abba70</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2157538</commentid>
    <comment_count>0</comment_count>
    <who name="Eranthis stellata Maxim">1012468643</who>
    <bug_when>2022-09-30 09:30:18 +0000</bug_when>
    <thetext>SUMMARY
Using &quot;Copy/Cut Selection to New Layer&quot; on the &quot;File Layer&quot; is not valid.
In 5.0.6, using &quot;Copy/Cut Select to New Layer&quot; on a &quot;File Layer&quot; is valid.


STEPS TO REPRODUCE
1. Add a &quot;File Layer&quot;.
2. Select an area of the File Layer.
3. Use &quot;Copy/Cut Select to New Layer&quot;.

OBSERVED RESULT
The result looks like I used copy and paste for the File layer.

EXPECTED RESULT
As in 5.0.6, using &quot;Copy/Cut Select to New Layer&quot; produces the effect of copying the selection to a new layer.

SOFTWARE/OS VERSIONS
Krita

 Version: 5.1.1
 Installation type: installer / portable package
 Hidpi: true

Qt

  Version (compiled): 5.12.12
  Version (loaded): 5.12.12

OS Information

  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.19044
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10

Locale

  Languages: en_US, en_US
  C locale: C
  QLocale current: en
  QLocale system: zh
  QTextCodec for locale: UTF-8
  Process ACP: 65001 (UTF-8)
  System locale default ACP: 936   (ANSI/OEM - 简体中文 GBK)

OpenGL Info
 
  Vendor:  &quot;Google Inc. (NVIDIA)&quot; 
  Renderer:  &quot;ANGLE (NVIDIA, NVIDIA GeForce GTX 970 Direct3D11 vs_5_0 ps_5_0, D3D11-31.0.15.1694)&quot; 
  Version:  &quot;OpenGL ES 3.0.0 (ANGLE 2.1.0 git hash: f2280c0c5f93+krita_qt5.12.12)&quot; 
  Shading language:  &quot;OpenGL ES GLSL ES 3.00 (ANGLE 2.1.0 git hash: f2280c0c5f93+krita_qt5.12.12)&quot; 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags&lt;QSurfaceFormat::FormatOption&gt;(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
  Current format:  QSurfaceFormat(version 3.0, options QFlags&lt;QSurfaceFormat::FormatOption&gt;(), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile) 
     Version: 3.0
     Supports deprecated functions false 
     is OpenGL ES: true 
  supportsBufferMapping: true 
  supportsBufferInvalidation: false 
  forceDisableTextureBuffers: true 
  Extensions: 
     &quot;GL_ANGLE_base_vertex_base_instance_shader_builtin&quot; 
     &quot;GL_OES_compressed_ETC2_sRGB8_texture&quot; 
     &quot;GL_ANGLE_depth_texture&quot; 
     &quot;GL_WEBGL_video_texture&quot; 
     &quot;GL_ANGLE_get_serialized_context_string&quot; 
     &quot;GL_OES_compressed_ETC2_punchthroughA_sRGB8_alpha_texture&quot; 
     &quot;GL_ANGLE_request_extension&quot; 
     &quot;GL_NV_pack_subimage&quot; 
     &quot;GL_OES_EGL_image&quot; 
     &quot;GL_CHROMIUM_bind_uniform_location&quot; 
     &quot;GL_OES_EGL_image_external_essl3&quot; 
     &quot;GL_EXT_draw_buffers&quot; 
     &quot;GL_ANGLE_program_cache_control&quot; 
     &quot;GL_EXT_texture_rg&quot; 
     &quot;GL_OES_draw_buffers_indexed&quot; 
     &quot;GL_OES_element_index_uint&quot; 
     &quot;GL_EXT_map_buffer_range&quot; 
     &quot;GL_OES_texture_float_linear&quot; 
     &quot;GL_EXT_texture_compression_bptc&quot; 
     &quot;GL_EXT_read_format_bgra&quot; 
     &quot;GL_ANGLE_framebuffer_blit&quot; 
     &quot;GL_EXT_color_buffer_half_float&quot; 
     &quot;GL_EXT_discard_framebuffer&quot; 
     &quot;GL_EXT_robustness&quot; 
     &quot;GL_OES_compressed_EAC_RG11_signed_texture&quot; 
     &quot;GL_EXT_disjoint_timer_query&quot; 
     &quot;GL_OES_texture_npot&quot; 
     &quot;GL_ANGLE_texture_multisample&quot; 
     &quot;GL_EXT_shader_texture_lod&quot; 
     &quot;GL_ANGLE_client_arrays&quot; 
     &quot;GL_OES_EGL_image_external&quot; 
     &quot;GL_CHROMIUM_sync_query&quot; 
     &quot;GL_ANGLE_memory_size&quot; 
     &quot;GL_OES_compressed_ETC2_punchthroughA_RGBA8_texture&quot; 
     &quot;GL_CHROMIUM_copy_compressed_texture&quot; 
     &quot;GL_KHR_parallel_shader_compile&quot; 
     &quot;GL_NV_EGL_stream_consumer_external&quot; 
     &quot;GL_OES_texture_stencil8&quot; 
     &quot;GL_EXT_instanced_arrays&quot; 
     &quot;GL_OES_texture_float&quot; 
     &quot;GL_EXT_debug_label&quot; 
     &quot;GL_EXT_frag_depth&quot; 
     &quot;GL_NV_framebuffer_blit&quot; 
     &quot;GL_OES_get_program_binary&quot; 
     &quot;GL_EXT_occlusion_query_boolean&quot; 
     &quot;GL_EXT_color_buffer_float&quot; 
     &quot;GL_OES_rgb8_rgba8&quot; 
     &quot;GL_ANGLE_copy_texture_3d&quot; 
     &quot;GL_ANGLE_texture_compression_dxt5&quot; 
     &quot;GL_AMD_performance_monitor&quot; 
     &quot;GL_OVR_multiview&quot; 
     &quot;GL_OES_depth24&quot; 
     &quot;GL_OES_depth32&quot; 
     &quot;GL_CHROMIUM_copy_texture&quot; 
     &quot;GL_EXT_blend_func_extended&quot; 
     &quot;GL_OES_compressed_EAC_R11_unsigned_texture&quot; 
     &quot;GL_CHROMIUM_lose_context&quot; 
     &quot;GL_EXT_blend_minmax&quot; 
     &quot;GL_NV_pixel_buffer_object&quot; 
     &quot;GL_OES_compressed_EAC_R11_signed_texture&quot; 
     &quot;GL_OES_packed_depth_stencil&quot; 
     &quot;GL_EXT_texture_compression_rgtc&quot; 
     &quot;GL_ANGLE_framebuffer_multisample&quot; 
     &quot;GL_EXT_EGL_image_external_wrap_modes&quot; 
     &quot;GL_OES_texture_half_float&quot; 
     &quot;GL_EXT_texture_filter_anisotropic&quot; 
     &quot;GL_EXT_multi_draw_indirect&quot; 
     &quot;GL_EXT_texture_format_BGRA8888&quot; 
     &quot;GL_OES_compressed_ETC2_sRGB8_alpha8_texture&quot; 
     &quot;GL_ANGLE_provoking_vertex&quot; 
     &quot;GL_ANGLE_robust_client_memory&quot; 
     &quot;GL_EXT_texture_norm16&quot; 
     &quot;GL_ANGLE_multi_draw&quot; 
     &quot;GL_EXT_float_blend&quot; 
     &quot;GL_OES_standard_derivatives&quot; 
     &quot;GL_OES_fbo_render_mipmap&quot; 
     &quot;GL_ANGLE_lossy_etc_decode&quot; 
     &quot;GL_OES_draw_elements_base_vertex&quot; 
     &quot;GL_OES_texture_half_float_linear&quot; 
     &quot;GL_ANGLE_pack_reverse_row_order&quot; 
     &quot;GL_EXT_clip_control&quot; 
     &quot;GL_ANGLE_translated_shader_source&quot; 
     &quot;GL_EXT_draw_elements_base_vertex&quot; 
     &quot;GL_EXT_debug_marker&quot; 
     &quot;GL_ANGLE_base_vertex_base_instance&quot; 
     &quot;GL_EXT_draw_buffers_indexed&quot; 
     &quot;GL_EXT_sRGB&quot; 
     &quot;GL_CHROMIUM_bind_generates_resource&quot; 
     &quot;GL_ANGLE_get_tex_level_parameter&quot; 
     &quot;GL_ANGLE_texture_usage&quot; 
     &quot;GL_EXT_texture_compression_s3tc_srgb&quot; 
     &quot;GL_ANGLE_texture_compression_dxt3&quot; 
     &quot;&quot; 
     &quot;GL_EXT_texture_compression_dxt1&quot; 
     &quot;GL_EXT_texture_storage&quot; 
     &quot;GL_KHR_debug&quot; 
     &quot;GL_OVR_multiview2&quot; 
     &quot;GL_OES_compressed_ETC2_RGBA8_texture&quot; 
     &quot;GL_ANGLE_multiview_multisample&quot; 
     &quot;GL_NV_fence&quot; 
     &quot;GL_OES_compressed_ETC2_RGB8_texture&quot; 
     &quot;GL_EXT_texture_type_2_10_10_10_REV&quot; 
     &quot;GL_EXT_multisampled_render_to_texture&quot; 
     &quot;GL_EXT_unpack_subimage&quot; 
     &quot;GL_OES_surfaceless_context&quot; 
     &quot;GL_OES_texture_border_clamp&quot; 
     &quot;GL_OES_vertex_array_object&quot; 
     &quot;GL_ANGLE_instanced_arrays&quot; 
     &quot;GL_OES_compressed_EAC_RG11_unsigned_texture&quot; 
     &quot;GL_OES_mapbuffer&quot; 

QPA OpenGL Detection Info 
  supportsDesktopGL: true 
  supportsAngleD3D11: true 
  isQtPreferAngle: true 

useBufferInvalidation (config option): false


Hardware Information

  GPU Acceleration: auto
  Memory: 32693 Mb
  Number of Cores: 16
  Swap Location: C:/Users/xi/AppData/Local/Temp
  Built for: sse2
  Base instruction set: sse2
  Supported instruction sets: fma3+avx2 avx2 fma3+avx avx fma4 fma3+sse4.2 sse4.2 sse4.1 ssse3 sse3 sse2 

Current Settings

  Current Swap Location: C:/Users/xi/AppData/Local/Temp
  Current Swap Location writable: true
  Undo Enabled: true
  Undo Stack Limit: 200
  Use OpenGL: true
  Use OpenGL Texture Buffer: true
  Disable Vector Optimizations: false
  Disable AVX Optimizations: false
  Canvas State: OPENGL_NOT_TRIED
  Autosave Interval: 420
  Use Backup Files: true
  Number of Backups Kept: 1
  Backup File Suffix: ~
  Backup Location: Same Folder as the File
  Backup Location writable: false
  Use Win8 Pointer Input: false
  Use RightMiddleTabletButton Workaround: false
  Levels of Detail Enabled: false
  Use Zip64: false


Display Information
Number of screens: 2
	Screen: 0
		Name: \\.\DISPLAY1
		Depth: 32
		Scale: 1
		Physical DPI117.596
		Logical DPI96
		Physical Size: 553, 311
		Position: 0, 0
		Resolution in pixels: 2560x1440
		Manufacturer: 
		Model: 
		Refresh Rate: 59
	Screen: 1
		Name: \\.\DISPLAY2
		Depth: 32
		Scale: 1
		Physical DPI141.951
		Logical DPI96
		Physical Size: 344, 193
		Position: 638, 1440
		Resolution in pixels: 1920x1080
		Manufacturer: 
		Model: 
		Refresh Rate: 60


---------------------
================================================================================
SESSION: 30 Sep 2022 17:15:04 +0800. Executing C:\Program Files\Krita (x64)\bin\krita.exe

Krita Version: 5.1.1, Qt version compiled: 5.12.12, loaded: 5.12.12. Process ID: 8892
-- -- -- -- -- -- -- --
30 Sep 2022 17:15:04 +0800: Style: fusion. Available styles: windowsvista, Windows, Fusion
30 Sep 2022 17:15:05 +0800: Creating database from scratch (database didn&apos;t exist, new schema version: 0.0.17).
30 Sep 2022 17:15:14 +0800: Non-store package - creating updater
30 Sep 2022 17:15:27 +0800: Created image &quot;Unnamed&quot;, 2480 * 3508 pixels, 300 dpi. Color model: 8-bit integer/channel RGB/Alpha (sRGB-elle-V2-srgbtrc.icc). Layers: 2
30 Sep 2022 17:15:41 +0800: Importing image/png to application/x-krita. Location: C:/Users/xi/AppData/Local/Temp/krita_file_layer_copy_8892_29503.png. Real location: C:/Users/xi/AppData/Local/Temp/krita_file_layer_copy_8892_29503.png. Batchmode: 1
30 Sep 2022 17:15:41 +0800: Loaded image from image/png. Size: 1024 * 512 pixels, 1 dpi. Color model: 8-bit integer/channel RGB/Alpha (sRGB-elle-V2-srgbtrc.icc). Layers: 2

---------------------</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2197917</commentid>
    <comment_count>1</comment_count>
    <who name="wolthera">griffinvalley</who>
    <bug_when>2023-01-16 14:26:01 +0000</bug_when>
    <thetext>Hi, thank you for your report.

I can confirm with the Krita Version: 5.2.0-prealpha (git 5c98a72) Appimage with Qt 5.15.7

I guess we should initialize the layer as empty and then only have the filled selection painted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2327230</commentid>
    <comment_count>2</comment_count>
    <who name="Freya Lupen">penguinflyer2222</who>
    <bug_when>2024-06-12 19:18:15 +0000</bug_when>
    <thetext>Git commit 09ff812f8316eea0a6bf55d49ec093c6a3ea41d2 by Freya Lupen.
Committed on 12/06/2024 at 19:17.
Pushed by freyalupen into branch &apos;master&apos;.

Fix copy-pasting selection of File Layer

If there&apos;s a selection, it should paste a new paint layer containing
the selection, instead of duplicating the entire File Layer.

M  +1    -1    libs/ui/actions/kis_selection_action_factories.cpp

https://invent.kde.org/graphics/krita/-/commit/09ff812f8316eea0a6bf55d49ec093c6a3ea41d2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2327231</commentid>
    <comment_count>3</comment_count>
    <who name="Freya Lupen">penguinflyer2222</who>
    <bug_when>2024-06-12 19:19:09 +0000</bug_when>
    <thetext>Git commit eb29ed416fa3dc6f49b5d65996570e39e5abba70 by Freya Lupen.
Committed on 12/06/2024 at 19:19.
Pushed by freyalupen into branch &apos;krita/5.2&apos;.

Fix copy-pasting selection of File Layer

If there&apos;s a selection, it should paste a new paint layer containing
the selection, instead of duplicating the entire File Layer.


(cherry picked from commit 09ff812f8316eea0a6bf55d49ec093c6a3ea41d2)

Co-authored-by: Freya Lupen &lt;penguinflyer2222@gmail.com&gt;

M  +1    -1    libs/ui/actions/kis_selection_action_factories.cpp

https://invent.kde.org/graphics/krita/-/commit/eb29ed416fa3dc6f49b5d65996570e39e5abba70</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>