mirror of https://github.com/kivy/kivy.git
Remove pep8 E265 from all files
block comment should start with '# ' sed rocks!
This commit is contained in:
parent
585a290f62
commit
efac1d7ac1
|
@ -48,17 +48,17 @@ class ObjFile:
|
|||
norms = f[1]
|
||||
tcs = f[2]
|
||||
for i in range(3):
|
||||
#get normal components
|
||||
# get normal components
|
||||
n = (0.0, 0.0, 0.0)
|
||||
if norms[i] != -1:
|
||||
n = self.normals[norms[i] - 1]
|
||||
|
||||
#get texture coordinate components
|
||||
# get texture coordinate components
|
||||
t = (0.0, 0.0)
|
||||
if tcs[i] != -1:
|
||||
t = self.texcoords[tcs[i] - 1]
|
||||
|
||||
#get vertex components
|
||||
# get vertex components
|
||||
v = self.vertices[verts[i] - 1]
|
||||
|
||||
data = [v[0], v[1], v[2], n[0], n[1], n[2], t[0], t[1]]
|
||||
|
@ -69,7 +69,7 @@ class ObjFile:
|
|||
idx += 3
|
||||
|
||||
self.objects[self._current_object] = mesh
|
||||
#mesh.calculate_normals()
|
||||
# mesh.calculate_normals()
|
||||
self.faces = []
|
||||
|
||||
def __init__(self, filename, swapyz=False):
|
||||
|
@ -94,9 +94,9 @@ class ObjFile:
|
|||
if values[0] == 'o':
|
||||
self.finish_object()
|
||||
self._current_object = values[1]
|
||||
#elif values[0] == 'mtllib':
|
||||
# elif values[0] == 'mtllib':
|
||||
# self.mtl = MTL(values[1])
|
||||
#elif values[0] in ('usemtl', 'usemat'):
|
||||
# elif values[0] in ('usemtl', 'usemat'):
|
||||
# material = values[1]
|
||||
if values[0] == 'v':
|
||||
v = list(map(float, values[1:4]))
|
||||
|
|
|
@ -10,9 +10,9 @@ throw an exception during the kv language processing.
|
|||
'''
|
||||
|
||||
# Uncomment these lines to see all the messages
|
||||
#from kivy.logger import Logger
|
||||
#import logging
|
||||
#Logger.setLevel(logging.TRACE)
|
||||
# from kivy.logger import Logger
|
||||
# import logging
|
||||
# Logger.setLevel(logging.TRACE)
|
||||
|
||||
from kivy.app import App
|
||||
from kivy.lang import Builder
|
||||
|
|
|
@ -44,7 +44,7 @@ class Puzzle(Camera):
|
|||
bx = x * bs
|
||||
by = y * bs
|
||||
subtexture = texture.get_region(bx, by, bs, bs)
|
||||
#node = PuzzleNode(texture=subtexture,
|
||||
# node = PuzzleNode(texture=subtexture,
|
||||
# size=(bs, bs), pos=(bx, by))
|
||||
node = Scatter(pos=(bx, by), size=(bs, bs))
|
||||
with node.canvas:
|
||||
|
|
|
@ -34,8 +34,8 @@ from kivy.clock import Clock
|
|||
|
||||
CATALOG_ROOT = os.path.dirname(__file__)
|
||||
|
||||
#Config.set('graphics', 'width', '1024')
|
||||
#Config.set('graphics', 'height', '768')
|
||||
# Config.set('graphics', 'width', '1024')
|
||||
# Config.set('graphics', 'height', '768')
|
||||
|
||||
'''List of classes that need to be instantiated in the factory from .kv files.
|
||||
'''
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#install_twisted_rector must be called before importing the reactor
|
||||
# install_twisted_rector must be called before importing the reactor
|
||||
from kivy.support import install_twisted_reactor
|
||||
install_twisted_reactor()
|
||||
|
||||
|
||||
#A simple Client that send messages to the echo server
|
||||
# A simple Client that send messages to the echo server
|
||||
from twisted.internet import reactor, protocol
|
||||
|
||||
|
||||
|
|
|
@ -98,8 +98,8 @@ class SvgApp(App):
|
|||
effect.add_widget(wid)
|
||||
|
||||
if 1:
|
||||
#from kivy.uix.image import Image
|
||||
#root.add_widget(Image(source='data/logo/kivy-icon-512.png',
|
||||
# from kivy.uix.image import Image
|
||||
# root.add_widget(Image(source='data/logo/kivy-icon-512.png',
|
||||
# size=(800, 600)))
|
||||
|
||||
filenames = sys.argv[1:]
|
||||
|
|
|
@ -42,15 +42,15 @@ class PongGame(Widget):
|
|||
def update(self, dt):
|
||||
self.ball.move()
|
||||
|
||||
#bounce ball off paddles
|
||||
# bounce ball off paddles
|
||||
self.player1.bounce_ball(self.ball)
|
||||
self.player2.bounce_ball(self.ball)
|
||||
|
||||
#bounce ball off bottom or top
|
||||
# bounce ball off bottom or top
|
||||
if (self.ball.y < self.y) or (self.ball.top > self.top):
|
||||
self.ball.velocity_y *= -1
|
||||
|
||||
#went off a side to score point?
|
||||
# went off a side to score point?
|
||||
if self.ball.x < self.x:
|
||||
self.player2.score += 1
|
||||
self.serve_ball(vel=(4, 0))
|
||||
|
|
|
@ -26,11 +26,11 @@ class PongGame(Widget):
|
|||
def update(self, dt):
|
||||
self.ball.move()
|
||||
|
||||
#bounce off top and bottom
|
||||
# bounce off top and bottom
|
||||
if (self.ball.y < 0) or (self.ball.top > self.height):
|
||||
self.ball.velocity_y *= -1
|
||||
|
||||
#bounce off left and right
|
||||
# bounce off left and right
|
||||
if (self.ball.x < 0) or (self.ball.right > self.width):
|
||||
self.ball.velocity_x *= -1
|
||||
|
||||
|
|
|
@ -39,15 +39,15 @@ class PongGame(Widget):
|
|||
def update(self, dt):
|
||||
self.ball.move()
|
||||
|
||||
#bounce of paddles
|
||||
# bounce of paddles
|
||||
self.player1.bounce_ball(self.ball)
|
||||
self.player2.bounce_ball(self.ball)
|
||||
|
||||
#bounce ball off bottom or top
|
||||
# bounce ball off bottom or top
|
||||
if (self.ball.y < self.y) or (self.ball.top > self.top):
|
||||
self.ball.velocity_y *= -1
|
||||
|
||||
#went of to a side to score point?
|
||||
# went of to a side to score point?
|
||||
if self.ball.x < self.x:
|
||||
self.player2.score += 1
|
||||
self.serve_ball(vel=(4, 0))
|
||||
|
|
|
@ -90,7 +90,7 @@ if __name__ == '__main__':
|
|||
# test with FboFloatLayout or FloatLayout
|
||||
# comment/uncomment to test it
|
||||
root = FboFloatLayout()
|
||||
#root = FloatLayout()
|
||||
# root = FloatLayout()
|
||||
|
||||
# this part of creation can be slow. try to optimize the loop a
|
||||
# little bit.
|
||||
|
|
|
@ -55,13 +55,13 @@ class mainclass(FloatLayout):
|
|||
# initialize variables
|
||||
self.sign = .10
|
||||
|
||||
#setup Layouts
|
||||
# setup Layouts
|
||||
layout = GridLayout(size_hint=(1, 1), cols=3, rows=1)
|
||||
left_frame = GridLayout(size_hint=(.25, 1), cols=1)
|
||||
client_frame = FloatLayout(size_hint=(1, 1))
|
||||
self.right_frame = Right_Frame()
|
||||
|
||||
#setup buttons in left frame
|
||||
# setup buttons in left frame
|
||||
but_load_gif = AnimatedButton(text='load gif', halign='center')
|
||||
but_load_zip_png = AnimatedButton(text='load zipped\n png/s',
|
||||
halign='center')
|
||||
|
@ -84,7 +84,7 @@ class mainclass(FloatLayout):
|
|||
background_normal='data/images/info.png',
|
||||
background_down='data/images/info.zip', halign='center')
|
||||
|
||||
#Handle button press/release
|
||||
# Handle button press/release
|
||||
def load_images(*l):
|
||||
if l[0].text == 'load gif' or l[0].text == 'load gif\n from cache':
|
||||
l[0].text = 'load gif\n from cache'
|
||||
|
@ -100,19 +100,19 @@ class mainclass(FloatLayout):
|
|||
|
||||
client_frame.add_widget(sctr, 1)
|
||||
|
||||
#position scatter
|
||||
# position scatter
|
||||
sctr.pos = (240 + self.sign, 200 + self.sign)
|
||||
self.sign += 10
|
||||
if self.sign > 200:
|
||||
self.sign = 10
|
||||
sctr.pos = (300, 200 - self.sign)
|
||||
|
||||
#bind function on on_release
|
||||
# bind function on on_release
|
||||
but_load_gif.bind(on_release=load_images)
|
||||
but_load_zip_png.bind(on_release=load_images)
|
||||
but_load_zip_jpg.bind(on_release=load_images)
|
||||
|
||||
#add widgets to left frame
|
||||
# add widgets to left frame
|
||||
left_frame.add_widget(but_load_gif)
|
||||
left_frame.add_widget(but_load_zip_png)
|
||||
left_frame.add_widget(but_load_zip_jpg)
|
||||
|
@ -121,16 +121,16 @@ class mainclass(FloatLayout):
|
|||
left_frame.add_widget(but_animated_borderless)
|
||||
left_frame.add_widget(but_animated_bordered)
|
||||
|
||||
#set/remove border for borderless widgets (16,16,16,16) by default
|
||||
# set/remove border for borderless widgets (16,16,16,16) by default
|
||||
but_animated_normal.border = \
|
||||
but_animated_borderless.border = (0, 0, 0, 0)
|
||||
|
||||
#add widgets to the main layout
|
||||
# add widgets to the main layout
|
||||
layout.add_widget(left_frame)
|
||||
layout.add_widget(client_frame)
|
||||
layout.add_widget(self.right_frame)
|
||||
|
||||
#add main layout to root
|
||||
# add main layout to root
|
||||
self.add_widget(layout)
|
||||
|
||||
def on_currentObj(self, *l):
|
||||
|
|
|
@ -27,26 +27,26 @@ class AnimatedButton(Label):
|
|||
|
||||
self.register_event_type('on_press')
|
||||
self.register_event_type('on_release')
|
||||
#borderImage.border by default is ...
|
||||
# borderImage.border by default is ...
|
||||
self.border = (16, 16, 16, 16)
|
||||
#Image to display depending on state
|
||||
# Image to display depending on state
|
||||
self.img = Image(
|
||||
source=self.background_normal,
|
||||
allow_stretch=self.allow_stretch,
|
||||
keep_ratio=self.keep_ratio,
|
||||
mipmap=True)
|
||||
|
||||
#reset animation if anim_delay is changed
|
||||
# reset animation if anim_delay is changed
|
||||
def anim_reset(*l):
|
||||
self.img.anim_delay = self.anim_delay
|
||||
|
||||
self.bind(anim_delay=anim_reset)
|
||||
self.anim_delay = .1
|
||||
#update self.texture when image.texture changes
|
||||
# update self.texture when image.texture changes
|
||||
self.img.bind(texture=self.on_tex_changed)
|
||||
self.on_tex_changed()
|
||||
|
||||
#update image source when background image is changed
|
||||
# update image source when background image is changed
|
||||
def background_changed(*l):
|
||||
self.img.source = self.background_normal
|
||||
self.anim_delay = .1
|
||||
|
|
|
@ -56,7 +56,7 @@ Builder.load_string('''
|
|||
<PanelLeft>
|
||||
size_hint: (.45, .45)
|
||||
pos_hint: {'center_x': .25, 'y': .55}
|
||||
#replace the default tab with our custom tab class
|
||||
# replace the default tab with our custom tab class
|
||||
default_tab_cls: sh.__class__
|
||||
do_default_tab: True
|
||||
default_tab_content: default_content.__self__
|
||||
|
@ -117,7 +117,7 @@ Builder.load_string('''
|
|||
pos_hint: {'center_x': .75, 'y': .55}
|
||||
# replace the default tab with our custom tab
|
||||
default_tab: def_tab
|
||||
#allow variable tab width
|
||||
# allow variable tab width
|
||||
tab_width: None
|
||||
FloatLayout:
|
||||
RstDocument:
|
||||
|
@ -255,7 +255,7 @@ Builder.load_string('''
|
|||
|
||||
class Tp(TabbedPanel):
|
||||
|
||||
#override tab switching method to animate on tab switch
|
||||
# override tab switching method to animate on tab switch
|
||||
def switch_to(self, header):
|
||||
anim = Animation(opacity=0, d=.24, t='in_out_quad')
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ from os.path import dirname, join
|
|||
from kivy.app import App
|
||||
from kivy.uix.videoplayer import VideoPlayer
|
||||
|
||||
#check what formats are supported for your targeted devices
|
||||
#for example try h264 video and acc audo for android using an mp4
|
||||
#container
|
||||
# check what formats are supported for your targeted devices
|
||||
# for example try h264 video and acc audo for android using an mp4
|
||||
# container
|
||||
|
||||
|
||||
class VideoPlayerApp(App):
|
||||
|
|
|
@ -345,11 +345,11 @@ class ListAdapter(Adapter, EventDispatcher):
|
|||
# [TODO] sibling selection for composite items
|
||||
# Needed? Or handled from parent?
|
||||
# (avoid circular, redundant selection)
|
||||
#if hasattr(view, 'parent') and hasattr(view.parent, 'children'):
|
||||
#siblings = [child for child in view.parent.children if child != view]
|
||||
#for sibling in siblings:
|
||||
#if hasattr(sibling, 'select'):
|
||||
#sibling.select()
|
||||
# if hasattr(view, 'parent') and hasattr(view.parent, 'children'):
|
||||
# siblings = [child for child in view.parent.children if child != view]
|
||||
# for sibling in siblings:
|
||||
# if hasattr(sibling, 'select'):
|
||||
# sibling.select()
|
||||
|
||||
if self.propagate_selection_to_data:
|
||||
data_item = self.get_data_item(view.index)
|
||||
|
@ -381,11 +381,11 @@ class ListAdapter(Adapter, EventDispatcher):
|
|||
# [TODO] sibling deselection for composite items
|
||||
# Needed? Or handled from parent?
|
||||
# (avoid circular, redundant selection)
|
||||
#if hasattr(view, 'parent') and hasattr(view.parent, 'children'):
|
||||
#siblings = [child for child in view.parent.children if child != view]
|
||||
#for sibling in siblings:
|
||||
#if hasattr(sibling, 'deselect'):
|
||||
#sibling.deselect()
|
||||
# if hasattr(view, 'parent') and hasattr(view.parent, 'children'):
|
||||
# siblings = [child for child in view.parent.children if child != view]
|
||||
# for sibling in siblings:
|
||||
# if hasattr(sibling, 'deselect'):
|
||||
# sibling.deselect()
|
||||
|
||||
if self.propagate_selection_to_data:
|
||||
item = self.get_data_item(view.index)
|
||||
|
|
|
@ -75,7 +75,7 @@ class Cache(object):
|
|||
Time after which to delete the object if it has not been used.
|
||||
If None, no timeout is applied.
|
||||
'''
|
||||
#check whether obj should not be cached first
|
||||
# check whether obj should not be cached first
|
||||
if getattr(obj, '_no_cache', False):
|
||||
return
|
||||
try:
|
||||
|
@ -85,8 +85,8 @@ class Cache(object):
|
|||
return
|
||||
timeout = timeout or cat['timeout']
|
||||
# FIXME: activate purge when limit is hit
|
||||
#limit = cat['limit']
|
||||
#if limit is not None and len(Cache._objects[category]) >= limit:
|
||||
# limit = cat['limit']
|
||||
# if limit is not None and len(Cache._objects[category]) >= limit:
|
||||
# Cache._purge_oldest(category)
|
||||
Cache._objects[category][key] = {
|
||||
'object': obj,
|
||||
|
|
|
@ -406,7 +406,7 @@ class ConfigParser(PythonConfigParser, object):
|
|||
# a str() conversion -> fail.
|
||||
# Instead we currently to the conversion to utf-8 when value are
|
||||
# "get()", but we internally store them in ascii.
|
||||
#with codecs.open(filename, 'r', encoding='utf-8') as f:
|
||||
# with codecs.open(filename, 'r', encoding='utf-8') as f:
|
||||
# self.readfp(f)
|
||||
old_vals = {sect: {k: v for k, v in self.items(sect)} for sect in
|
||||
self.sections()}
|
||||
|
|
|
@ -224,7 +224,7 @@ try:
|
|||
from kivy.lib.gstplayer import GstPlayer # NOQA
|
||||
audio_libs += [('gstplayer', 'audio_gstplayer')]
|
||||
except ImportError:
|
||||
#audio_libs += [('gi', 'audio_gi')]
|
||||
# audio_libs += [('gi', 'audio_gi')]
|
||||
if PY2:
|
||||
audio_libs += [('pygst', 'audio_pygst')]
|
||||
audio_libs += [('ffpyplayer', 'audio_ffpyplayer')]
|
||||
|
|
|
@ -141,7 +141,7 @@ elif platform == 'macosx':
|
|||
elif platform == 'android':
|
||||
providers += (('android', 'camera_android', 'CameraAndroid'), )
|
||||
else:
|
||||
#providers += (('gi', 'camera_gi', 'CameraGi'), )
|
||||
# providers += (('gi', 'camera_gi', 'CameraGi'), )
|
||||
providers += (('pygst', 'camera_pygst', 'CameraPyGst'), )
|
||||
|
||||
providers += (('opencv', 'camera_opencv', 'CameraOpenCV'), )
|
||||
|
|
|
@ -66,7 +66,7 @@ class CameraOpenCV(CameraBase):
|
|||
# frame).
|
||||
self._resolution = (int(frame.width), int(frame.height))
|
||||
|
||||
#get fps
|
||||
# get fps
|
||||
self.fps = cv.GetCaptureProperty(self._device, cv.CV_CAP_PROP_FPS)
|
||||
if self.fps <= 0:
|
||||
self.fps = 1 / 30.
|
||||
|
|
|
@ -80,7 +80,7 @@ class ClipboardAndroid(ClipboardBase):
|
|||
clippy = PythonActivity._clipboard
|
||||
|
||||
if sdk < 11:
|
||||
#versions previous to honeycomb
|
||||
# versions previous to honeycomb
|
||||
clippy.setText(AndroidString(data))
|
||||
else:
|
||||
ClipData = autoclass('android.content.ClipData')
|
||||
|
|
|
@ -327,7 +327,7 @@ class ImageLoader(object):
|
|||
image = None
|
||||
for zfilename in znamelist:
|
||||
try:
|
||||
#read file and store it in mem with fileIO struct around it
|
||||
# read file and store it in mem with fileIO struct around it
|
||||
tmpfile = BytesIO(z.read(zfilename))
|
||||
ext = zfilename.split('.')[-1].lower()
|
||||
im = None
|
||||
|
@ -349,7 +349,7 @@ class ImageLoader(object):
|
|||
# overwritten
|
||||
image_data.append(im._data[0])
|
||||
image = im
|
||||
#else: if not image file skip to next
|
||||
# else: if not image file skip to next
|
||||
except:
|
||||
Logger.warning('Image: Unable to load image'
|
||||
'<%s> in zip <%s> trying to continue...'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#-*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# this program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -27,8 +27,8 @@ http://www.java2s.com/Open-Source/Python/Network/\
|
|||
emesene/emesene-1.6.2/pygif/pygif.py.htm'''
|
||||
|
||||
|
||||
#TODO issues to fix
|
||||
#optimize for speed #partially done# a lot of room for improvement
|
||||
# TODO issues to fix
|
||||
# optimize for speed #partially done# a lot of room for improvement
|
||||
import struct
|
||||
from array import array
|
||||
|
||||
|
@ -73,7 +73,7 @@ class ImageLoaderGIF(ImageLoaderBase):
|
|||
else im_palette
|
||||
have_transparent_color = img.has_transparent_color
|
||||
transparent_color = img.transparent_color
|
||||
#draw_method_restore_previous = 1 \
|
||||
# draw_method_restore_previous = 1 \
|
||||
# if img.draw_method == 'restore previous' else 0
|
||||
draw_method_replace = 1 \
|
||||
if ((img.draw_method == 'replace') or
|
||||
|
@ -90,7 +90,7 @@ class ImageLoaderGIF(ImageLoaderBase):
|
|||
img_height = ls_height
|
||||
img_width = ls_width
|
||||
left = top = 0
|
||||
#reverse top to bottom and left to right
|
||||
# reverse top to bottom and left to right
|
||||
tmp_top = (ls_height - (img_height + top))
|
||||
img_width_plus_left = (img_width + left)
|
||||
ls_width_multiply_4 = ls_width * 4
|
||||
|
@ -103,8 +103,8 @@ class ImageLoaderGIF(ImageLoaderBase):
|
|||
rgba_pos = (tmp_top * ls_width_multiply_4) + (left_multiply_4)
|
||||
tmp_top += 1
|
||||
while i < img_width_plus_left:
|
||||
#this should now display corrupted gif's
|
||||
#instead of crashing on gif's not decoded properly
|
||||
# this should now display corrupted gif's
|
||||
# instead of crashing on gif's not decoded properly
|
||||
try:
|
||||
(r, g, b) = palette[pixels[x + i]]
|
||||
except:
|
||||
|
@ -116,17 +116,17 @@ class ImageLoaderGIF(ImageLoaderBase):
|
|||
if have_transparent_color:
|
||||
if transparent_color == pixels[x + i]:
|
||||
if draw_method_replace:
|
||||
#transparent pixel draw method replace
|
||||
# transparent pixel draw method replace
|
||||
pixel_map[rgba_pos + 3] = 0
|
||||
rgba_pos += 4
|
||||
i += 1
|
||||
continue
|
||||
#transparent pixel draw method combine
|
||||
# transparent pixel draw method combine
|
||||
rgba_pos += 4
|
||||
i += 1
|
||||
continue
|
||||
# this pixel isn't transparent
|
||||
#doesn't have transparent color
|
||||
# doesn't have transparent color
|
||||
(pixel_map[rgba_pos], pixel_map[rgba_pos + 1],
|
||||
pixel_map[rgba_pos + 2]) = (r, g, b)
|
||||
pixel_map[rgba_pos + 3] = 255
|
||||
|
@ -154,9 +154,9 @@ class Gif(object):
|
|||
|
||||
# struct format strings
|
||||
|
||||
#17,18:
|
||||
# 17,18:
|
||||
FMT_HEADER = '<6sHHBBB'
|
||||
#20:
|
||||
# 20:
|
||||
FMT_IMGDESC = '<HHHHB'
|
||||
|
||||
IMAGE_SEPARATOR = 0x2C
|
||||
|
@ -274,7 +274,7 @@ class ImageDescriptor(object):
|
|||
self.local_color_table_flag = self.flags[7]
|
||||
self.interlace_flag = self.flags[6]
|
||||
self.sort_flag = self.flags[5]
|
||||
#-- flags 4 and 3 are reserved
|
||||
# -- flags 4 and 3 are reserved
|
||||
self.local_color_table_size = 2 ** (pack_bits(self.flags[:3]) + 1)
|
||||
if self.local_color_table_flag:
|
||||
if Debug:
|
||||
|
@ -310,8 +310,8 @@ class GifDecoder(Gif):
|
|||
# start reading from the beggining of the file
|
||||
self.pointer = 0
|
||||
|
||||
#17. Header.
|
||||
#18. Logical Screen Descriptor.
|
||||
# 17. Header.
|
||||
# 18. Logical Screen Descriptor.
|
||||
data = self.pops(Gif.FMT_HEADER, self.data)
|
||||
|
||||
self.header = data[0]
|
||||
|
@ -322,15 +322,15 @@ class GifDecoder(Gif):
|
|||
|
||||
# flags field
|
||||
self.flags = get_bits(data[3])
|
||||
#1 bit
|
||||
# 1 bit
|
||||
self.color_table_flag = self.flags[7]
|
||||
self.sort_flag = self.flags[3]
|
||||
#3 bit
|
||||
# 3 bit
|
||||
self.color_resolution = pack_bits(self.flags[4:7]) # 7 not included
|
||||
#3 bit
|
||||
# 3 bit
|
||||
self.global_color_table_size = 2 ** (pack_bits(self.flags[:3]) + 1)
|
||||
|
||||
#19. Global Color Table.
|
||||
# 19. Global Color Table.
|
||||
if self.color_table_flag:
|
||||
size = (self.global_color_table_size) * 3
|
||||
self.palette = self.get_color_table(size)
|
||||
|
@ -360,7 +360,7 @@ class GifDecoder(Gif):
|
|||
except:
|
||||
nextbyte = 0x3b # force end
|
||||
|
||||
#20. Image Descriptor
|
||||
# 20. Image Descriptor
|
||||
if nextbyte == Gif_IMAGE_SEPARATOR:
|
||||
descriptor = self_pops(Gif_FMT_IMGDESC, self_data)
|
||||
image = self_new_image(descriptor)
|
||||
|
@ -370,7 +370,7 @@ class GifDecoder(Gif):
|
|||
image.codesize = self_pops('<B', self_data)[0]
|
||||
image.lzwcode = b''
|
||||
image_lzwcode = image.lzwcode
|
||||
###TODO too many corner casses for gifs:(
|
||||
### TODO too many corner casses for gifs:(
|
||||
table_size = image.local_color_table_size\
|
||||
if image.local_color_table_flag and \
|
||||
self.global_color_table_size < image.local_color_table_size\
|
||||
|
|
|
@ -60,7 +60,7 @@ class ImageLoaderPygame(ImageLoaderBase):
|
|||
if im is None:
|
||||
im = pygame.image.load(filename)
|
||||
except:
|
||||
#Logger.warning(type(filename)('Image: Unable to load image <%s>')
|
||||
# Logger.warning(type(filename)('Image: Unable to load image <%s>')
|
||||
# % filename)
|
||||
raise
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ try:
|
|||
from kivy.lib.gstplayer import GstPlayer # NOQA
|
||||
video_providers += [('gstplayer', 'video_gstplayer', 'VideoGstplayer')]
|
||||
except ImportError:
|
||||
#video_providers += [('gi', 'video_gi', 'VideoGi')]
|
||||
# video_providers += [('gi', 'video_gi', 'VideoGi')]
|
||||
if PY2:
|
||||
# if peoples do not have gi, fallback on pygst, only for python2
|
||||
video_providers += [
|
||||
|
|
|
@ -190,7 +190,7 @@ class VideoFFPy(VideoBase):
|
|||
self._texture = Texture.create(size=self._size, colorfmt='rgba')
|
||||
|
||||
# XXX FIXME
|
||||
#self.texture.add_reload_observer(self.reload_buffer)
|
||||
# self.texture.add_reload_observer(self.reload_buffer)
|
||||
self._texture.flip_vertical()
|
||||
self.dispatch('on_load')
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ class VideoGi(VideoBase):
|
|||
seek_flags = Gst.SeekFlags.FLUSH | Gst.SeekFlags.KEY_UNIT
|
||||
self._playbin.seek_simple(seek_format, seek_flags, seek_t)
|
||||
|
||||
#if pipeline is not playing, we need to pull pre-roll to update frame
|
||||
# if pipeline is not playing, we need to pull pre-roll to update frame
|
||||
if not self._state == 'playing':
|
||||
with self._buffer_lock:
|
||||
self._buffer = self._appsink.emit('pull-preroll')
|
||||
|
|
|
@ -8,8 +8,8 @@ import pyglet
|
|||
from kivy.core.video import VideoBase
|
||||
|
||||
|
||||
#have to set these before importing pyglet.gl
|
||||
#otherwise pyglet creates a separate gl context and fails
|
||||
# have to set these before importing pyglet.gl
|
||||
# otherwise pyglet creates a separate gl context and fails
|
||||
# on error checks because we use pygame window
|
||||
pyglet.options['shadow_window'] = False
|
||||
pyglet.options['debug_gl'] = False
|
||||
|
@ -39,12 +39,12 @@ class VideoPyglet(VideoBase):
|
|||
def load(self):
|
||||
self.unload() # make sure we unload an resources
|
||||
|
||||
#load media file and set size of video
|
||||
# load media file and set size of video
|
||||
self._source = source = pyglet.media.load(self._filename)
|
||||
self._format = source.video_format
|
||||
self.size = (self._format.width, self._format.height)
|
||||
|
||||
#load pyglet player and have it play the video we loaded
|
||||
# load pyglet player and have it play the video we loaded
|
||||
self._player = None
|
||||
self._player = pyglet.media.Player()
|
||||
self._player.queue(source)
|
||||
|
|
|
@ -162,7 +162,7 @@ class VideoPyGst(VideoBase):
|
|||
seek_flags = gst.SEEK_FLAG_FLUSH | gst.SEEK_FLAG_KEY_UNIT
|
||||
self._playbin.seek_simple(seek_format, seek_flags, seek_t)
|
||||
|
||||
#if pipeline is not playing, we need to pull pre-roll to update frame
|
||||
# if pipeline is not playing, we need to pull pre-roll to update frame
|
||||
if not self._state == 'playing':
|
||||
with self._buffer_lock:
|
||||
self._buffer = self._appsink.emit('pull-preroll')
|
||||
|
|
|
@ -154,7 +154,7 @@ class WindowPygame(WindowBase):
|
|||
|
||||
info = pygame.display.Info()
|
||||
self._size = (info.current_w, info.current_h)
|
||||
#self.dispatch('on_resize', *self._size)
|
||||
# self.dispatch('on_resize', *self._size)
|
||||
|
||||
# in order to debug futur issue with pygame/display, let's show
|
||||
# more debug output.
|
||||
|
|
|
@ -466,9 +466,9 @@ class WindowSDL(WindowBase):
|
|||
|
||||
self._mouse_meta = self.modifiers
|
||||
self._mouse_btn = btn
|
||||
#times = x if y == 0 else y
|
||||
#times = min(abs(times), 100)
|
||||
#for k in range(times):
|
||||
# times = x if y == 0 else y
|
||||
# times = min(abs(times), 100)
|
||||
# for k in range(times):
|
||||
self._mouse_down = True
|
||||
self.dispatch('on_mouse_down',
|
||||
self._mouse_x, self._mouse_y, btn, self.modifiers)
|
||||
|
@ -562,7 +562,7 @@ class WindowSDL(WindowBase):
|
|||
kstr = unichr(key)
|
||||
except ValueError:
|
||||
pass
|
||||
#if 'shift' in self._modifiers and key\
|
||||
# if 'shift' in self._modifiers and key\
|
||||
# not in self.command_keys.keys():
|
||||
# return
|
||||
|
||||
|
@ -630,7 +630,7 @@ class WindowSDL(WindowBase):
|
|||
def mainloop(self):
|
||||
# don't known why, but pygame required a resize event
|
||||
# for opengl, before mainloop... window reinit ?
|
||||
#self.dispatch('on_resize', *self.size)
|
||||
# self.dispatch('on_resize', *self.size)
|
||||
|
||||
while not EventLoop.quit and EventLoop.status == 'started':
|
||||
try:
|
||||
|
|
|
@ -85,7 +85,7 @@ class LeapFingerEventProvider(MotionEventProvider):
|
|||
available_uid = []
|
||||
for hand in frame.hands:
|
||||
for finger in hand.fingers:
|
||||
#print hand.id(), finger.id(), finger.tip()
|
||||
# print hand.id(), finger.id(), finger.tip()
|
||||
uid = '{0}:{1}'.format(hand.id, finger.id)
|
||||
available_uid.append(uid)
|
||||
position = finger.tip_position
|
||||
|
|
|
@ -215,7 +215,7 @@ class SafeMembrane(object):
|
|||
# methods that make calls against _ref and threadsafe whenever data will be
|
||||
# written to or if a method will be called. SafeMembrane instances should
|
||||
# be unwrapped whenever passing them into the thread
|
||||
#use type() to determine if an object is a SafeMembrane while debugging
|
||||
# use type() to determine if an object is a SafeMembrane while debugging
|
||||
def __repr__(self):
|
||||
return self._ref.__repr__()
|
||||
|
||||
|
@ -322,14 +322,14 @@ class InteractiveLauncher(SafeMembrane):
|
|||
|
||||
def run(self):
|
||||
self.thread.start()
|
||||
#Proxy behavior starts after this is set. Before this point, attaching
|
||||
#widgets etc can only be done through the Launcher's app attribute
|
||||
# Proxy behavior starts after this is set. Before this point, attaching
|
||||
# widgets etc can only be done through the Launcher's app attribute
|
||||
self._ref = self.app
|
||||
|
||||
def stop(self):
|
||||
EventLoop.quit = True
|
||||
self.thread.join()
|
||||
|
||||
#Act like the app instance even before _ref is set
|
||||
# Act like the app instance even before _ref is set
|
||||
def __repr__(self):
|
||||
return self.app.__repr__()
|
||||
|
|
|
@ -260,7 +260,7 @@ class LoaderBase(object):
|
|||
try:
|
||||
proto = filename.split(':', 1)[0]
|
||||
except:
|
||||
#if blank filename then return
|
||||
# if blank filename then return
|
||||
return
|
||||
if load_callback is not None:
|
||||
data = load_callback(filename)
|
||||
|
|
|
@ -67,7 +67,7 @@ Logger = None
|
|||
|
||||
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = list(range(8))
|
||||
|
||||
#These are the sequences need to get colored ouput
|
||||
# These are the sequences need to get colored ouput
|
||||
RESET_SEQ = "\033[0m"
|
||||
COLOR_SEQ = "\033[1;%dm"
|
||||
BOLD_SEQ = "\033[1m"
|
||||
|
|
|
@ -54,10 +54,10 @@ devices = {
|
|||
'nexus7': ('Nexus 7 (2012 version)', 1280, 800, 216, 1.325),
|
||||
'nexus7.2': ('Nexus 7 (2013 version)', 1920, 1200, 323, 2),
|
||||
|
||||
#taken from design.google.com/devices
|
||||
#please consider using another data instead of
|
||||
#a dict for autocompletion to work
|
||||
#these are all in landscape
|
||||
# taken from design.google.com/devices
|
||||
# please consider using another data instead of
|
||||
# a dict for autocompletion to work
|
||||
# these are all in landscape
|
||||
'phone_android_one': ('Android One', 854, 480, 218, 1.5),
|
||||
'phone_htc_one_m8': ('HTC One M8', 1920, 1080, 432, 3.0),
|
||||
'phone_htc_one_m9': ('HTC One M9', 1920, 1080, 432, 3.0),
|
||||
|
|
|
@ -94,7 +94,7 @@ class GraphicUnitTest(_base):
|
|||
from shutil import move, copy
|
||||
|
||||
# don't save screenshot until we have enough frames.
|
||||
#log.debug('framecount %d' % self.framecount)
|
||||
# log.debug('framecount %d' % self.framecount)
|
||||
self.framecount -= 1
|
||||
if self.framecount > 0:
|
||||
return
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#-*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
import unittest
|
||||
|
||||
|
||||
|
|
|
@ -90,10 +90,10 @@ class PropertiesTestCase(unittest.TestCase):
|
|||
a.set(wid, 99)
|
||||
self.assertEqual(a.get(wid), 99)
|
||||
|
||||
#try:
|
||||
# try:
|
||||
# a.set(wid, '') # string shouldn't be accepted
|
||||
# self.fail('number accept string, fail.')
|
||||
#except ValueError:
|
||||
# except ValueError:
|
||||
# pass
|
||||
|
||||
def test_listcheck(self):
|
||||
|
|
|
@ -55,13 +55,13 @@ class FactoryBuild(Command):
|
|||
ignore = True
|
||||
break
|
||||
if ignore:
|
||||
#print('<<< ignored (ignore list)')
|
||||
# print('<<< ignored (ignore list)')
|
||||
continue
|
||||
|
||||
# special case, core providers
|
||||
if root.startswith('kivy.core.'):
|
||||
if not root.endswith('__init__.py'):
|
||||
#print('<<< ignored (not a __init__.py)')
|
||||
# print('<<< ignored (not a __init__.py)')
|
||||
continue
|
||||
|
||||
print('>>>', module, '::', end=' ')
|
||||
|
|
|
@ -308,7 +308,7 @@ class Bubble(GridLayout):
|
|||
if self_arrow_pos == 'bottom_left':
|
||||
arrow_list = (self_arrow_img, Widget(), Widget())
|
||||
elif self_arrow_pos == 'bottom_right':
|
||||
#add two dummy widgets
|
||||
# add two dummy widgets
|
||||
arrow_list = (Widget(), Widget(), self_arrow_img)
|
||||
widget_list = (self_content, self_arrow_layout)
|
||||
else:
|
||||
|
@ -320,7 +320,7 @@ class Bubble(GridLayout):
|
|||
size=self_arrow_img.size)
|
||||
sctr.add_widget(self_arrow_img)
|
||||
if self_arrow_pos == 'top_mid':
|
||||
#add two dummy widgets
|
||||
# add two dummy widgets
|
||||
arrow_list = (Widget(), sctr, Widget())
|
||||
elif self_arrow_pos == 'top_left':
|
||||
arrow_list = (sctr, Widget(), Widget())
|
||||
|
|
|
@ -133,16 +133,16 @@ class FloatLayout(Layout):
|
|||
|
||||
def add_widget(self, widget, index=0):
|
||||
widget.bind(
|
||||
#size=self._trigger_layout,
|
||||
#size_hint=self._trigger_layout,
|
||||
# size=self._trigger_layout,
|
||||
# size_hint=self._trigger_layout,
|
||||
pos=self._trigger_layout,
|
||||
pos_hint=self._trigger_layout)
|
||||
return super(FloatLayout, self).add_widget(widget, index)
|
||||
|
||||
def remove_widget(self, widget):
|
||||
widget.unbind(
|
||||
#size=self._trigger_layout,
|
||||
#size_hint=self._trigger_layout,
|
||||
# size=self._trigger_layout,
|
||||
# size_hint=self._trigger_layout,
|
||||
pos=self._trigger_layout,
|
||||
pos_hint=self._trigger_layout)
|
||||
return super(FloatLayout, self).remove_widget(widget)
|
||||
|
|
|
@ -657,11 +657,11 @@ class RstDocument(ScrollView):
|
|||
# get the anchor coordinate inside widget space
|
||||
ax += node.x
|
||||
ay = node.top - ay
|
||||
#ay += node.y
|
||||
# ay += node.y
|
||||
|
||||
# what's the current coordinate for us?
|
||||
sx, sy = self.scatter.x, self.scatter.top
|
||||
#ax, ay = self.scatter.to_parent(ax, ay)
|
||||
# ax, ay = self.scatter.to_parent(ax, ay)
|
||||
|
||||
ay -= self.height
|
||||
|
||||
|
@ -859,7 +859,7 @@ class _Visitor(nodes.NodeVisitor):
|
|||
label = RstTitle(section=self.section, document=self.root)
|
||||
self.current.add_widget(label)
|
||||
self.push(label)
|
||||
#assert(self.text == '')
|
||||
# assert(self.text == '')
|
||||
|
||||
elif cls is nodes.Text:
|
||||
if self.do_strip_text:
|
||||
|
|
|
@ -135,7 +135,7 @@ class Sandbox(FloatLayout):
|
|||
|
||||
@sandbox
|
||||
def _clock_sandbox(self, dt):
|
||||
#import pdb; pdb.set_trace()
|
||||
# import pdb; pdb.set_trace()
|
||||
Clock.tick()
|
||||
Builder.sync()
|
||||
|
||||
|
@ -155,11 +155,11 @@ if __name__ == '__main__':
|
|||
class TestButton(Button):
|
||||
|
||||
def on_touch_up(self, touch):
|
||||
#raise Exception('fdfdfdfdfdfdfd')
|
||||
# raise Exception('fdfdfdfdfdfdfd')
|
||||
return super(TestButton, self).on_touch_up(touch)
|
||||
|
||||
def on_touch_down(self, touch):
|
||||
#raise Exception('')
|
||||
# raise Exception('')
|
||||
return super(TestButton, self).on_touch_down(touch)
|
||||
|
||||
s = Sandbox()
|
||||
|
@ -181,10 +181,10 @@ if __name__ == '__main__':
|
|||
texture: self.texture
|
||||
|
||||
# invalid... for testing.
|
||||
#on_touch_up: root.d()
|
||||
#on_touch_down: root.f()
|
||||
# on_touch_up: root.d()
|
||||
# on_touch_down: root.f()
|
||||
on_release: root.args()
|
||||
#on_press: root.args()
|
||||
# on_press: root.args()
|
||||
''')
|
||||
b = TestButton(text='Hello World')
|
||||
s.add_widget(b)
|
||||
|
|
|
@ -1149,9 +1149,9 @@ if __name__ == '__main__':
|
|||
class TestApp(App):
|
||||
|
||||
def change_view(self, *l):
|
||||
#d = ('left', 'up', 'down', 'right')
|
||||
#di = d.index(self.sm.transition.direction)
|
||||
#self.sm.transition.direction = d[(di + 1) % len(d)]
|
||||
# d = ('left', 'up', 'down', 'right')
|
||||
# di = d.index(self.sm.transition.direction)
|
||||
# self.sm.transition.direction = d[(di + 1) % len(d)]
|
||||
self.sm.current = next(self.sm)
|
||||
|
||||
def remove_screen(self, *l):
|
||||
|
|
|
@ -163,7 +163,7 @@ class TabbedPanelHeader(ToggleButton):
|
|||
# only allow selecting the tab if not already selected
|
||||
def on_touch_down(self, touch):
|
||||
if self.state == 'down':
|
||||
#dispatch to children, not to self
|
||||
# dispatch to children, not to self
|
||||
for child in self.children:
|
||||
child.dispatch('on_touch_down', touch)
|
||||
return
|
||||
|
@ -723,7 +723,7 @@ class TabbedPanel(GridLayout):
|
|||
if tab_pos == 'bottom_left':
|
||||
tab_list = (scrl_v, Widget(), Widget())
|
||||
elif tab_pos == 'bottom_right':
|
||||
#add two dummy widgets
|
||||
# add two dummy widgets
|
||||
tab_list = (Widget(), Widget(), scrl_v)
|
||||
widget_list = (self_content, tab_layout)
|
||||
else:
|
||||
|
@ -772,11 +772,11 @@ class TabbedPanel(GridLayout):
|
|||
# fine but touch won't translate to the correct position
|
||||
|
||||
if tab_pos[lentab_pos - 4:] == '_top':
|
||||
#on positions 'left_top' and 'right_top'
|
||||
# on positions 'left_top' and 'right_top'
|
||||
sctr.bind(pos=partial(self._update_top, sctr, 'top', None))
|
||||
tab_list = (sctr, )
|
||||
elif tab_pos[lentab_pos - 4:] == '_mid':
|
||||
#calculate top of scatter
|
||||
# calculate top of scatter
|
||||
sctr.bind(pos=partial(self._update_top, sctr, 'mid',
|
||||
scrl_v.width))
|
||||
tab_list = (Widget(), sctr, Widget())
|
||||
|
@ -810,7 +810,7 @@ class TabbedPanel(GridLayout):
|
|||
if tab.size_hint_x:
|
||||
# size_hint_x: x/.xyz
|
||||
tab.size_hint_x = 1
|
||||
#drop to default tab_width
|
||||
# drop to default tab_width
|
||||
tsw += 100
|
||||
else:
|
||||
# size_hint_x: None
|
||||
|
@ -837,10 +837,10 @@ class TabbedPanel(GridLayout):
|
|||
self_tab_pos = self.tab_pos
|
||||
self_tabs = self._tab_strip
|
||||
if self_tab_pos[0] == 'b' or self_tab_pos[0] == 't':
|
||||
#bottom or top
|
||||
# bottom or top
|
||||
scrl_v.width = min(self.width, self_tabs.width)
|
||||
#required for situations when scrl_v's pos is calculated
|
||||
#when it has no parent
|
||||
# required for situations when scrl_v's pos is calculated
|
||||
# when it has no parent
|
||||
scrl_v.top += 1
|
||||
scrl_v.top -= 1
|
||||
else:
|
||||
|
|
|
@ -861,7 +861,7 @@ class TextInput(FocusBehavior, Widget):
|
|||
self._delete_line(cr)
|
||||
start = cr - 1
|
||||
else:
|
||||
#ch = text[cc-1]
|
||||
# ch = text[cc-1]
|
||||
substring = text[cc - 1]
|
||||
new_text = text[:cc - 1] + text[cc:]
|
||||
self._set_line_text(cr, new_text)
|
||||
|
@ -888,7 +888,7 @@ class TextInput(FocusBehavior, Widget):
|
|||
self._undo.append({
|
||||
'undo_command': ('bkspc', new_index, substring),
|
||||
'redo_command': ol_index})
|
||||
#reset redo when undo is appended to
|
||||
# reset redo when undo is appended to
|
||||
self._redo = []
|
||||
|
||||
_re_whitespace = re.compile(r'\s+')
|
||||
|
@ -1257,7 +1257,7 @@ class TextInput(FocusBehavior, Widget):
|
|||
# allows smoother scrolling, noticeably
|
||||
# faster when dealing with large text.
|
||||
self._update_graphics_selection()
|
||||
#self._trigger_update_graphics()
|
||||
# self._trigger_update_graphics()
|
||||
|
||||
#
|
||||
# Touch control
|
||||
|
@ -1806,7 +1806,7 @@ class TextInput(FocusBehavior, Widget):
|
|||
mode = 'all'
|
||||
if len(largs) > 1:
|
||||
mode, start, finish, _lines, _lines_flags, len_lines = largs
|
||||
#start = max(0, start)
|
||||
# start = max(0, start)
|
||||
cursor = None
|
||||
else:
|
||||
cursor = self.cursor_index()
|
||||
|
@ -1841,7 +1841,7 @@ class TextInput(FocusBehavior, Widget):
|
|||
min_line_ht = self._label_cached.get_extents('_')[1]
|
||||
# with markup texture can be of height `1`
|
||||
self.line_height = max(_lines_labels[0].height, min_line_ht)
|
||||
#self.line_spacing = 2
|
||||
# self.line_spacing = 2
|
||||
# now, if the text change, maybe the cursor is not at the same place as
|
||||
# before. so, try to set the cursor on the good place
|
||||
row = self.cursor_row
|
||||
|
@ -2290,7 +2290,7 @@ class TextInput(FocusBehavior, Widget):
|
|||
elif internal_action == 'escape':
|
||||
self.focus = False
|
||||
if internal_action != 'escape':
|
||||
#self._recalc_size()
|
||||
# self._recalc_size()
|
||||
pass
|
||||
|
||||
def _key_up(self, key, repeat=False):
|
||||
|
@ -2406,7 +2406,7 @@ class TextInput(FocusBehavior, Widget):
|
|||
if self._selection:
|
||||
self.delete_selection()
|
||||
self.insert_text(text)
|
||||
#self._recalc_size()
|
||||
# self._recalc_size()
|
||||
return
|
||||
|
||||
if is_interesting_key:
|
||||
|
@ -3148,7 +3148,7 @@ if __name__ == '__main__':
|
|||
root = BoxLayout(orientation='vertical')
|
||||
textinput = TextInput(multiline=True, use_bubble=True,
|
||||
use_handles=True)
|
||||
#textinput.text = __doc__
|
||||
# textinput.text = __doc__
|
||||
root.add_widget(textinput)
|
||||
textinput2 = TextInput(multiline=False, text='monoline textinput',
|
||||
size_hint=(1, None), height=30)
|
||||
|
|
|
@ -334,7 +334,7 @@ class Vector(list):
|
|||
|
||||
For math see: http://en.wikipedia.org/wiki/Line-line_intersection
|
||||
'''
|
||||
#linear algebar sucks...seriously!!
|
||||
# linear algebar sucks...seriously!!
|
||||
x1, x2, x3, x4 = float(v1[0]), float(v2[0]), float(v3[0]), float(v4[0])
|
||||
y1, y2, y3, y4 = float(v1[1]), float(v2[1]), float(v3[1]), float(v4[1])
|
||||
|
||||
|
@ -369,10 +369,10 @@ class Vector(list):
|
|||
>>> Vector.segment_intersection(a, b, c, d)
|
||||
[5, 5]
|
||||
'''
|
||||
#Yaaay! I love linear algebra applied within the realms of geometry.
|
||||
# Yaaay! I love linear algebra applied within the realms of geometry.
|
||||
x1, x2, x3, x4 = float(v1[0]), float(v2[0]), float(v3[0]), float(v4[0])
|
||||
y1, y2, y3, y4 = float(v1[1]), float(v2[1]), float(v3[1]), float(v4[1])
|
||||
#This is mostly the same as the line_intersection
|
||||
# This is mostly the same as the line_intersection
|
||||
u = (x1 * y2 - y1 * x2)
|
||||
v = (x3 * y4 - y3 * x4)
|
||||
denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4)
|
||||
|
@ -381,7 +381,7 @@ class Vector(list):
|
|||
|
||||
px = (u * (x3 - x4) - (x1 - x2) * v) / denom
|
||||
py = (u * (y3 - y4) - (y1 - y2) * v) / denom
|
||||
#Here are the new bits
|
||||
# Here are the new bits
|
||||
c1 = (x1 <= px <= x2) or (x2 <= px <= x1)
|
||||
c2 = (y1 <= py <= y2) or (y2 <= py <= y1)
|
||||
c3 = (x3 <= px <= x4) or (x4 <= px <= x3)
|
||||
|
|
Loading…
Reference in New Issue