Fixed too long location overflowing box

This commit is contained in:
nitko12 2020-08-03 15:37:18 +02:00
parent 71277c517d
commit 65381a7251
14 changed files with 232 additions and 2 deletions

BIN
docs/build/doctrees/begin.doctree vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

26
docs/build/html/_sources/begin.rst.txt vendored Normal file
View File

@ -0,0 +1,26 @@
.. Inkplate 6 documentation master file, created by
sphinx-quickstart on Mon Aug 3 13:10:28 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
*************
.begin method
*************
.. toctree::
:maxdepth: 2
:caption: Contents:
*************
What is this?
*************
Used to intiate Inkplate
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -10,6 +10,7 @@ Welcome to Inkplate 6's documentation!
:maxdepth: 2
:caption: Contents:
begin
*************
What is this?

127
docs/build/html/begin.html vendored Normal file
View File

@ -0,0 +1,127 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>.begin method &#8212; Inkplate 6 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Welcome to Inkplate 6s documentation!" href="index.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="begin-method">
<h1>.begin method<a class="headerlink" href="#begin-method" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
</div>
</div>
<div class="section" id="what-is-this">
<h1>What is this?<a class="headerlink" href="#what-is-this" title="Permalink to this headline"></a></h1>
<p>Used to intiate Inkplate</p>
<div class="section" id="indices-and-tables">
<h2>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline"></a></h2>
<ul class="simple">
<li><p><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></p></li>
<li><p><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></p></li>
<li><p><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></p></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">Inkplate 6</a></h1>
<h3>Navigation</h3>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">.begin method</a><ul class="simple">
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="#what-is-this">What is this?</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="index.html" title="previous chapter">Welcome to Inkplate 6s documentation!</a></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2020, e-radionica.com.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 3.1.2</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="_sources/begin.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>

View File

@ -55,6 +55,11 @@
<h3>Navigation</h3>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="begin.html">.begin method</a></li>
<li class="toctree-l1"><a class="reference internal" href="begin.html#what-is-this">What is this?</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>

View File

@ -15,6 +15,7 @@
<script src="_static/language_data.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title=".begin method" href="begin.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
@ -34,6 +35,16 @@
<div class="section" id="welcome-to-inkplate-6-s-documentation">
<h1>Welcome to Inkplate 6s documentation!<a class="headerlink" href="#welcome-to-inkplate-6-s-documentation" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="begin.html">.begin method</a><ul class="simple">
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="begin.html#what-is-this">What is this?</a><ul>
<li class="toctree-l2"><a class="reference internal" href="begin.html#indices-and-tables">Indices and tables</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="what-is-this">
<h2>What is this?<a class="headerlink" href="#what-is-this" title="Permalink to this headline"></a></h2>
@ -70,11 +81,17 @@
<h3>Navigation</h3>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="begin.html">.begin method</a></li>
<li class="toctree-l1"><a class="reference internal" href="begin.html#what-is-this">What is this?</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="#">Documentation overview</a><ul>
<li>Next: <a href="begin.html" title="next chapter">.begin method</a></li>
</ul></li>
</ul>
</div>

Binary file not shown.

View File

@ -74,6 +74,11 @@
<h3>Navigation</h3>
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="begin.html">.begin method</a></li>
<li class="toctree-l1"><a class="reference internal" href="begin.html#what-is-this">What is this?</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>

View File

@ -1 +1 @@
Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["index.rst"],objects:{},objnames:{},objtypes:{},terms:{"function":0,For:0,aaaa:[],all:0,can:0,code:0,descript:0,exampl:0,file:0,find:0,first:0,header:0,here:0,includ:0,index:0,kako:[],librari:0,like:0,modul:0,need:0,our:0,ovo:[],page:0,print:[],radi:[],rang:[],search:0,test:[],top:0,work:0,you:0,your:0,znam:[]},titles:["Welcome to Inkplate 6\u2019s documentation!"],titleterms:{document:0,indic:0,inkplat:0,tabl:0,thi:0,welcom:0,what:0}})
Search.setIndex({docnames:["begin","index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["begin.rst","index.rst"],objects:{},objnames:{},objtypes:{},terms:{"function":1,For:1,Used:0,aaaa:[],all:1,begin:1,can:1,code:1,content:1,descript:1,exampl:1,file:1,find:1,first:1,header:1,here:1,includ:1,index:[0,1],inkplat:0,intiat:0,kako:[],librari:1,like:1,method:1,modul:[0,1],need:1,our:1,ovo:[],page:[0,1],print:[],radi:[],rang:[],search:[0,1],test:[],top:1,work:1,you:1,your:1,znam:[]},titles:[".begin method","Welcome to Inkplate 6\u2019s documentation!"],titleterms:{begin:0,document:1,indic:[0,1],inkplat:1,method:0,tabl:[0,1],thi:[0,1],welcom:1,what:[0,1]}})

26
docs/source/begin.rst Normal file
View File

@ -0,0 +1,26 @@
.. Inkplate 6 documentation master file, created by
sphinx-quickstart on Mon Aug 3 13:10:28 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
*************
.begin method
*************
.. toctree::
:maxdepth: 2
:caption: Contents:
*************
What is this?
*************
Used to intiate Inkplate
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

View File

@ -10,6 +10,7 @@ Welcome to Inkplate 6's documentation!
:maxdepth: 2
:caption: Contents:
begin
*************
What is this?

View File

@ -296,7 +296,29 @@ bool drawEvent(entry *event, int day, int beginY, int maxHeigth, int *heigthNeed
display.println(event->time);
display.setCursor(x1, display.getCursorY());
display.print(event->location);
char line[128] = {0};
for (int i = 0; i < strlen(event->location); ++i)
{
line[i] = event->location[i];
line[i + 1] = 0;
int16_t xt1, yt1;
uint16_t w, h;
// Gets text bounds
display.getTextBounds(line, 0, 0, &xt1, &yt1, &w, &h);
if (w > (594 / 3))
{
for (int j = i - 1; j > max(-1, i - 4); --j)
line[j] = '.';
line[i] = 0;
}
}
display.print(line);
}
else
{