diff --git a/conf.py b/conf.py index b78b7ff17..84ebb8305 100644 --- a/conf.py +++ b/conf.py @@ -1,373 +1,375 @@ # -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/stable/config # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # import os # import sys # sys.path.insert(0, os.path.abspath('.')) # -- Project information ----------------------------------------------------- project = 'Krita Manual' propername = 'Krita Manual' description = 'The official Krita Documentation' copyright = 'licensed under the GNU Free Documentation License 1.3+ unless stated otherwise' author = 'Krita Foundation' import os import subprocess # Get the git description if possible, to put it in the footer. try: gitcommitfriendly = subprocess.check_output(["git", "describe", "--always"]).decode("utf-8").strip() except subprocess.CalledProcessError as exc: gitcommitfriendly = None # We use the full githash for the epub identifier, if not, use the release number. try: gitcommithash = subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode("utf-8").strip() except subprocess.CalledProcessError as exc: gitcommithash = release # The short X.Y version version = '4.2' # The full version, including alpha/beta/rc tags release = '4.2.0' # -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', 'sphinx.ext.githubpages', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The master toctree document. master_doc = 'index' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = 'en' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path . exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] html_extra_path = ['.htaccess', '404.php'] # copy over .htaccess file to each langaguge # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # languages to exclude from smartquotes transformation. Requested by catalan translators due l':ref:`` getting rendered as l"crop tool. smartquotes_excludes = {'languages':[ 'ja', 'ca', 'fr' ], 'builders': [ 'man', 'text' ] } # A string of reStructuredText that will be included at the end of every source file that is read. # This is a possible place to add substitutions that should be available in every file (another being rst_prolog). rst_epilog = """ .. |mouseleft| image:: /images/icons/Krita_mouse_left.png .. |mouseright| image:: /images/icons/Krita_mouse_right.png .. |mousemiddle| image:: /images/icons/Krita_mouse_middle.png .. |mousescroll| image:: /images/icons/Krita_mouse_scroll.png .. |toolshapeselection| image:: /images/icons/shape_select_tool.svg .. |toolshapeedit| image:: /images/icons/shape_edit_tool.svg .. |tooltext| image:: /images/icons/text-tool.svg .. |toolcalligraphy| image:: /images/icons/calligraphy_tool.svg .. |toolgradientedit| image:: /images/icons/gradient_edit_tool.svg .. |toolpatternedit| image:: /images/icons/pattern_tool.svg .. |toolfreehandbrush| image:: /images/icons/freehand_brush_tool.svg .. |toolline| image:: /images/icons/line_tool.svg .. |toolrectangle| image:: /images/icons/rectangle_tool.svg .. |toolellipse| image:: /images/icons/ellipse_tool.svg .. |toolpolygon| image:: /images/icons/polygon_tool.svg .. |toolpolyline| image:: /images/icons/polyline_tool.svg .. |toolbeziercurve| image:: /images/icons/bezier_curve.svg .. |toolfreehandpath| image:: /images/icons/freehand_path_tool.svg .. |tooldyna| image:: /images/icons/dyna_tool.svg .. |toolmultibrush| image:: /images/icons/multibrush_tool.svg .. |toolassistant| image:: /images/icons/assistant_tool.svg .. |toolmove| image:: /images/icons/move_tool.svg .. |tooltransform| image:: /images/icons/transform_tool.svg .. |toolgrid| image:: /images/icons/grid_tool.svg .. |toolperspectivegrid| image:: /images/icons/perspectivegrid_tool.svg .. |toolmeasure| image:: /images/icons/measure_tool.svg .. |toolcolorpicker| image:: /images/icons/color_picker_tool.svg .. |toolfill| image:: /images/icons/fill_tool.svg .. |toolgradient| image:: /images/icons/gradient_drawing_tool.svg .. |toolcolorizemask| image:: /images/icons/colorizemask_tool.svg .. |toolsmartpatch| image:: /images/icons/smart_patch_tool.svg .. |toolcrop| image:: /images/icons/crop_tool.svg .. |toolselectrect| image:: /images/icons/rectangular_select_tool.svg .. |toolselectellipse| image:: /images/icons/elliptical_select_tool.svg .. |toolselectpolygon| image:: /images/icons/polygonal_select_tool.svg +.. |toolselectmagnetic| image:: /images/icons/magnetic_select_tool.svg + .. |toolselectpath| image:: /images/icons/path_select_tool.svg .. |toolselectoutline| image:: /images/icons/outline_select_tool.svg .. |toolselectcontiguous| image:: /images/icons/contiguous_select_tool.svg .. |toolselectsimilar| image:: /images/icons/similar_select_tool.svg .. |toolpan| image:: /images/icons/pan_tool.svg .. |toolzoom| image:: /images/icons/zoom_tool.svg .. |toolreference| image:: /images/icons/reference_images_tool.svg """ # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'theme' html_theme_path = ['.'] # make sphinx search for themes in current dir # the favicon has a property to set it in the documentation, but we don't need to use this # sphinx appears to automatically search in the theme folder and find the file #html_favicon = './theme/static/images/favicon.ico' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = { 'sticky_navigation': True, 'collapse_navigation': True, 'prev_next_buttons_location': 'bottom' } # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['theme/static'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. # # The default sidebars (for documents that don't match any pattern) are # defined by theme itself. Builtin themes are using these templates by # default: ``['localtoc.html', 'relations.html', 'sourcelink.html', # 'searchbox.html']``. # # html_sidebars = {} html_title = project + " version " + release html_context = { 'build_id': os.getenv('BUILD_NUMBER', None), 'build_url': os.getenv('BUILD_URL', None), 'commit' : gitcommitfriendly } # -- Options for HTMLHelp output --------------------------------------------- # Output file base name for HTML help builder. htmlhelp_basename = 'documentationProjectNamedoc' # -- Options for LaTeX output ------------------------------------------------ latex_engine = 'xelatex' latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', 'maxlistdepth': '8', 'figure_align':'ht!', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # 'preamble': r''' \usepackage[export]{adjustbox} \let\oincludegraphics\includegraphics \renewcommand{\includegraphics}[2][]{ \oincludegraphics[#1,max width=\linewidth,max height=\textheight]{#2} } ''', 'tableofcontents':'\sphinxtableofcontents', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'kritaManual.tex', project, author, 'manual'), ] latex_show_pagerefs=True # copy latex scripts to build dir latex_additional_files = [ "latexImageMakefile", ] # -- Internationalization Options -------------------------------------------- locale_dirs = ['locale/'] # Where the PO files will be stored at gettext_compact = False # optional. gettext_additional_targets = ['image', 'index', 'literal-block'] # allows images to be translatable figure_language_filename = "{path}{language}/{basename}{ext}" # -- Options for manual page output ------------------------------------------ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, project, propername, [author], 1) ] # -- Options for Texinfo output ---------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, project, propername, author, project, description, 'Manual'), ] # -- Options for Epub output ------------------------------------------------- # Bibliographic Dublin Core info. # filename # epub_basename = project.replace(' ', '_') + '_' + language epub_title = project+" "+version epub_description = description # Technically speaking dublincore accepts multiple author and contributor elements, but # the sphinx builder only accepts one. epub_author = author epub_publisher = author epub_copyright = copyright epub_cover = ('_static/images/manual_cover.png', '') # The unique identifier of the text. This can be a ISBN number # or the project homepage. # The above is false and perhaps a mistake in sphinx' documentation. # epub_uid maps to id, which is the dc identifier id # which in turn should be the used scheme. if os.getenv('BUILD_ID', None) is None: # There is no uniform resource name for git, but just randomly pasting a githash is bad form. epub_identifier = 'git:'+gitcommithash epub_uid = 'githash' if gitcommithash == release: epub_uid = 'release' # there's also no urn for releases, as technically some database thing should be used for that. epub_identifier = '_'.join(['Krita_Manual_Build', language, release]) else: epub_uid = 'url' epub_identifier = os.getenv('BUILD_URL', '') # Not actually used anywhere? Docs say that this should be what the epub uid is used for but... epub_scheme = 'URL' # A list of files that should not be packed into the epub file. epub_exclude_files = ['search.html', '.htaccess', '404.xhtml'] epub_tocscope = 'includehidden' # -- Extension configuration ------------------------------------------------- # -- Options for intersphinx extension --------------------------------------- # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'https://docs.python.org/': None} diff --git a/images/icons/magnetic_selection_tool.svg b/images/icons/magnetic_selection_tool.svg new file mode 100644 index 000000000..07f84e0bd --- /dev/null +++ b/images/icons/magnetic_selection_tool.svg @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Andrei Rudenko + + + + + + + + + + + diff --git a/reference_manual/tools.rst b/reference_manual/tools.rst index ad6239570..b229a7af3 100644 --- a/reference_manual/tools.rst +++ b/reference_manual/tools.rst @@ -1,49 +1,50 @@ .. _cat_tools: ===== Tools ===== The contents of the toolbox docker. .. toctree:: :maxdepth: 1 tools/shape_selection tools/shape_edit tools/text tools/gradient_edit tools/pattern_edit tools/calligraphy tools/freehand_brush tools/line tools/rectangle tools/ellipse tools/polygon tools/polyline tools/path tools/freehand_path tools/dyna tools/multibrush tools/crop tools/move tools/transform tools/fill tools/gradient_draw tools/color_selector tools/colorize_mask tools/grid_tool tools/perspective_grid tools/smart_patch tools/assistant tools/reference_images_tool tools/measure tools/rectangular_select tools/elliptical_select tools/outline_select tools/polygonal_select tools/contiguous_select tools/path_select tools/similar_select + tools/magnetic_select tools/zoom tools/pan diff --git a/reference_manual/tools/magnetic_select.rst b/reference_manual/tools/magnetic_select.rst new file mode 100644 index 000000000..594afa62f --- /dev/null +++ b/reference_manual/tools/magnetic_select.rst @@ -0,0 +1,89 @@ +.. meta:: + :description: + Krita's Magnetic Selection tool reference. + +.. metadata-placeholder + + :authors: - Wolthera van Hövell tot Westerflier + - Kuntal Majumer + :license: GNU free documentation license 1.3 or later. + +.. index:: Tools, Magnet, Selection, Magnetic Selection +.. _magnetic_selection_tool: + +======================= +Magnetic Selection Tool +======================= + +|toolselectmagnetic| + +This tool, represented by a magnet over a selection border, allows you to make freeform :ref:`selections_basics`, but unlike the :ref:`polygonal_selection_tool` or the :ref:`outline_selection_tool`, it will try to magnetically snap to sharp contrasts in your image, simplifying the creation of selection drastically. + +There are two ways to make a magnetic selection: + +The first is to use |mouseleft| and place points or nodes of the magnetic selection. To finalize your selection area you can do either |mouseleft| on the first created point, or press :kbd:`Enter` to end the magnetic selection. + +The second is to |mouseleft| + drag over a portion of an image. + +You can edit previous points by |mouseleft| dragging them. You can remove points by double |mouseleft| the point, or dragging it out of the canvas area. After a path is closed, you can add points by clicking on nearby empty space. Points can be undone with :kbd:`Shift + Z`. A selection can be canceled with :kbd:`Esc`. + +.. important:: + + Most of the behavior of the Magnetic Selection Tool is common to all other selection tools, please make sure to read :ref:`selections_basics` to learn more about this tool. + + + +Hotkeys and Sticky keys +----------------------- + +* :kbd:`R` sets the selection to 'replace' in the tool options, this is the default mode. +* :kbd:`A` sets the selection to 'add' in the tool options. +* :kbd:`S` sets the selection to 'subtract' in the tool options. +* :kbd:`Shift +` |mouseleft| sets the subsequent selection to 'add'. You can release the :kbd:`Shift` key while dragging, but it will still be set to 'add'. Same for the others.* :kbd:`Alt` + |mouseleft| sets the subsequent selection to 'subtract'. +* :kbd:`Ctrl` + |mouseleft| sets the subsequent selection to 'replace'. +* :kbd:`Shift + Alt +` |mouseleft| sets the subsequent selection to 'intersect'. + +.. versionadded:: 4.2 + + * Hovering your cursor over the dashed line of the selection, or marching ants as it is commonly called, turns the cursor into the move tool icon, which you |mouseleft| and drag to move the selection. + * |mouseright| will open up a selection quick menu with amongst others the ability to edit the selection. + +.. image:: /images/tools/selections-right-click-menu.png + :width: 200 + :alt: Menu of polygonal selection + +.. tip:: + + You can switch the behavior of the :kbd:`Alt` key to use :kbd:`Ctrl` instead by toggling the switch in Tool Settings in the :ref:`general_settings`. + +.. tip:: + + This tool is not bound to any Hotkey, if you want to define one, go to :menuselection:`Settings --> Configure Krita --> Keyboard Shortcuts` and search for 'Magnetic Selection Tool', there you can select the shortcut you want. Check :ref:`shortcut_settings` for more info. + + +Tool Options +------------ + +.. image:: /images/tools/selections-polygonal-selection-options.png + :width: 300 + :alt: Polygonal selection options + +Mode + This option is explained in the :ref:`pixel_vector_selection` section. +Action + This option is explained in the :ref:`pixel_vector_selection` section. +Anti-aliasing + This toggles whether or not to give selections feathered edges. Some people prefer hard-jagged edges for their selections. +Filter Radius: + Determine the radius of the edge detection kernel. This determines how agressively the tool will interpret contrasts. Low values mean only the sharpest of contrast will be a seen as an edge. High values will pick up on subtle contrasts. The range of which is from 2.5 to 100. +Threshold: + From 0 to 255, how sharp your egde is, 0 is least while 255 is the most. Used in the Interactive mode only. +Search Radius: + The area in which the tool will search for a sharp contrast within an image. More pixels means less precision is needed when placing the points, but this will require Krita to do more work, and thus slows down the tool. +Anchor Gap: + When using |mouseleft|+drag to place points automatically, this value determines the average gap between 2 anchors. Low values give high precision by placing many nodes, but this is also harder to edit afterwards. + + +.. note:: + + Anti-aliasing is only available on Pixel Selection Mode.